ffmpeg-devel
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
January 2022
- 93 participants
- 351 discussions
08 Mar '22
Hi,
add %{localtime_ms}, %{gmtime_ms} functions to the drawtext filter. Same
as %{localtime}/%{gmtime} but with additional millisecond part.
sorry for delay, second version including review remarks:
-get timing once
-also add gmtime_ms instead of just localtime_ms
Thanks,
Thilo
7
41
Several fixes since v2, including using '+' as separator for channels instead
of '|', as the latter is used to separate layouts.
Like last time custom layouts contain an opaque pointer and fixed size array
per channel to hold a user defined name that helpers will use to identify the
channel (find by name, describe as part of a layout, etc). There's also an
opaque pointer for the layout regardless of order.
This time i'm sending the whole set, but it can also be found in
https://github.com/jamrial/FFmpeg/commits/channel_layout4
Anton Khirnov (136):
Add a new channel layout API
lavu: support AVChannelLayout AVOptions
lavc: deprecate channel count/layout changing side data
avframe: switch to the new channel layout API
lavf: add a temporary compat layer for the channel layout API change
lavf: convert the generic layer to the new channel layout
3dostr: convert to new channel layout API
aa: convert to new channel layout API
acm: convert to new channel layout API
act: convert to new channel layout API
adp: convert to new channel layout API
ads: convert to new channel layout API
afc: convert to new channel layout API
aixdec: convert to new channel layout API
aptxdec: convert to new channel layout API
argo: convert to new channel layout API
ast: convert to new channel layout API
avr: convert to new channel layout API
bit: convert to new channel layout API
boa: convert to new channel layout API
brstm: convert to new channel layout API
codec2: convert to new channel layout API
dcstr: convert to new channel layout API
dhav: convert to new channel layout API
dtshddec: convert to new channel layout API
dsfdec: convert to new channel layout API
epafdec: convert to new channel layout API
framehash: convert to new channel layout API
fsb: convert to new channel layout API
g726: convert to new channel layout API
gdv: convert to new channel layout API
genh: convert to new channel layout API
hcom: convert to new channel layout API
ifv: convert to new channel layout API
ircam: convert to new channel layout API
jack: port to new channel layout API
libcdio: port to new channel layout API
lvf: convert to new channel layout API
mpeg: convert to new channel layout API
mpegtsenc: convert to new channel layout API
msf: convert to new channel layout API
mtaf: convert to new channel layout API
musx: convert to new channel layout API
nistspheredec: convert to new channel layout API
nspdec: convert to new channel layout API
oss: port to new channel layout API
pvf: convert to new channel layout API
rawenc: convert to new channel layout API
redspark: convert to new channel layout API
rsd: convert to new channel layout API
sbg: convert to new channel layout API
sdr2: convert to new channel layout API
sds: convert to new channel layout API
sdx: convert to new channel layout API
svag: convert to new channel layout API
vag: convert to new channel layout API
vividas: convert to new channel layout API
vivo: convert to new channel layout API
vpk: convert to new channel layout API
lavf: drop the channel layout compat layer for old-style (de)muxers
8svx: convert to new channel layout API
aac: convert to new channel layout API
adpcm: convert to new channel layout API
alac: convert to new channel layout API
amr: convert to new channel layout API
aptx: convert to new channel layout API
atrac9: convert to new channel layout API
apedec: convert to new channel layout API
audiotoolbox: convert to new channel layout API
binkaudio: convert to new channel layout API
bmvaudio: convert to new channel layout API
cng: convert to new channel layout API
cook: convert to new channel layout API
dca: convert to new channel layout API
dolby_e: convert to new channel layout API
dsd: convert to new channel layout API
dsicinav: convert to new channel layout API
dst: convert to new channel layout API
dvaudio: convert to new channel layout API
evrc: convert to new channel layout API
ffwavesynth: convert to new channel layout API
flac: convert to new channel layout API
g722: convert to new channel layout API
g723_1: convert to new channel layout API
g726: convert to new channel layout API
g729: convert to new channel layout API
gsmdec: convert to new channel layout API
hcom: convert to new channel layout API
ilbc: convert to new channel layout API
imc: convert to new channel layout API
interplayacm: convert to new channel layout API
libcelt: convert to new channel layout API
libcodec2: convert to new channel layout API
libilbc: convert to new channel layout API
libgsm: convert to new channel layout API
libmp3lame: convert to new channel layout API
libopencore-amr: convert to new channel layout API
libopus: convert to new channel layout API
libshine: convert to new channel layout API
libspeexdec: convert to new channel layout API
libtwolame: convert to new channel layout API
libvo-amrwbenc: convert to new channel layout API
libvorbis: convert to new channel layout API
mace: convert to new channel layout API
metasound: convert to new channel layout API
mlp: convert to new channel layout API
mpc7: convert to new channel layout API
mpc8: convert to new channel layout API
mpegaudio: convert to new channel layout API
nellymoser: convert to new channel layout API
on2avc: convert to new channel layout API
opus: convert to new channel layout API
pcm: convert to new channel layout API
qcelpdec: convert to new channel layout API
qdmc: convert to new channel layout API
qdm2: convert to new channel layout API
ra144: convert to new channel layout API
ra288: convert to new channel layout API
ralf: convert to new channel layout API
roqaudioenc: convert to new channel layout API
s302m: convert to new channel layout API
sbc: convert to new channel layout API
shorten: convert to new channel layout API
sipr: convert to new channel layout API
smacker: convert to new channel layout API
sonic: convert to new channel layout API
tak: convert to new channel layout API
truespeech: convert to new channel layout API
tta: convert to new channel layout API
vmdaudio: convert to new channel layout API
vorbis: convert to new channel layout API
wavpack: convert to new channel layout API
wma: convert to new channel layout API
ws-snd1: convert to new channel layout API
lavc: drop temporary compat wrappers for channel layout API change
opus: export mapping family 2 (Ambisonic) as Ambisonic layout
James Almer (32):
fate: add a channel_layout API test
aax: convert to new channel layout API
ace: convert to new channel layout API
alsa: convert to new channel layout API
alp: convert to new channel layout API
amv: convert to new channel layout API
apm: convert to new channel layout API
derf: convert to new channel layout API
dshow: convert to new channel layout API
fwse: convert to new channel layout API
hca: convert to new channel layout API
hls_sample_encryption: convert to new channel layout API
imx: convert to new channel layout API
kvag: convert to new channel layout API
avdevice/lavfi: convert to new channel layout API
mca: convert to new channel layout API
moflex: convert to new channel layout API
pp_bnk: convert to new channel layout API
scd: convert to new channel layout API
sga: convert to new channel layout API
svs: convert to new channel layout API
uncodedframecrcenc: convert to new channel layout API
fastaudio: convert to new channel layout API
hca: convert to new channel layout API
mf: convert to new channel layout API
siren: convert to new channel layout API
speex: convert to new channel layout API
swresample: convert to new channel layout API
avfilter: convert to new channel layout API
avdevice/lavfi: remove call to deprecated function
av_buffersink_get_channel_layout()
ffmpeg: convert to new channel layout-API
ffprobe: convert to new channel layout-API
Vittorio Giovara (113):
avcodecpar: switch to the new channel layout API
4xm: convert to new channel layout API
adxdec: convert to new channel layout API
aea: convert to new channel layout API
aiff: convert to new channel layout API
amr: convert to new channel layout API
apc: convert to new channel layout API
ape: convert to new channel layout API
au: convert to new channel layout API
bethsoftvid: convert to new channel layout API
bfi: convert to new channel layout API
bink: convert to new channel layout API
bmv: convert to new channel layout API
caf: convert to new channel layout API
cdxl: convert to new channel layout API
dash: convert to new channel layout API
dsicin: convert to new channel layout API
dss: convert to new channel layout API
dv: convert to new channel layout API
eac: convert to new channel layout API
electronicarts: convert to new channel layout API
flac: convert to new channel layout API
flic: convert to new channel layout API
flv: convert to new channel layout API
g722: convert to new channel layout API
g723_1: convert to new channel layout API
g729: convert to new channel layout API
gsm: convert to new channel layout API
gxf: convert to new channel layout API
idcin: convert to new channel layout API
idroq: convert to new channel layout API
iff: convert to new channel layout API
ilbc: convert to new channel layout API
ipmovie: convert to new channel layout API
iss: convert to new channel layout API
jvdec: convert to new channel layout API
lxfdec: convert to new channel layout API
matroska: convert to new channel layout API
mm: convert to new channel layout API
mmf: convert to new channel layout API
mov: convert to new channel layout API
movenc-test: convert to new channel layout API
mp3: convert to new channel layout API
mpc: convert to new channel layout API
mpc8: convert to new channel layout API
mpegenc: convert to new channel layout API
mvdec: convert to new channel layout API
mvi: convert to new channel layout API
mxf: convert to new channel layout API
mxg: convert to new channel layout API
nsvdec: convert to new channel layout API
nutdec: convert to new channel layout API
nuv: convert to new channel layout API
ogg: convert to new channel layout API
oma: convert to new channel layout API
paf: convert to new channel layout API
pcm: convert to new channel layout API
pmp: convert to new channel layout API
psxstr: convert to new channel layout API
qcp: convert to new channel layout API
r3d: convert to new channel layout API
riff: convert to new channel layout API
rl2: convert to new channel layout API
rm: convert to new channel layout API
rpl: convert to new channel layout API
rso: convert to new channel layout API
rtp: convert to new channel layout API
sdp: convert to new channel layout API
segafilm: convert to new channel layout API
sierravmd: convert to new channel layout API
siff: convert to new channel layout API
smacker: convert to new channel layout API
smjpegenc: convert to new channel layout API
smoothstreaming: convert to new channel layout API
smush: convert to new channel layout API
sol: convert to new channel layout API
sox: convert to new channel layout API
swf: convert to new channel layout API
tak: convert to new channel layout API
thp: convert to new channel layout API
tiertexseq: convert to new channel layout API
tmv: convert to new channel layout API
tta: convert to new channel layout API
voc: convert to new channel layout API
vqf: convert to new channel layout API
wav: convert to new channel layout API
wc3movie: convert to new channel layout API
westwood: convert to new channel layout API
wtv: convert to new channel layout API
wv: convert to new channel layout API
xa: convert to new channel layout API
xmv: convert to new channel layout API
xwma: convert to new channel layout API
yop: convert to new channel layout API
wsd: convert to new channel layout API
wve: convert to new channel layout API
xvag: convert to new channel layout API
lavc: switch to the new channel layout API
ac3: convert to new channel layout API
adx: convert to new channel layout API
als: convert to new channel layout API
atrac1: convert to new channel layout API
atrac3: convert to new channel layout API
atrac3plus: convert to new channel layout API
dpcm: convert to new channel layout API
dss_sp: convert to new channel layout API
libfdk-aac: convert to new channel layout API
pafaudio: convert to new channel layout API
twinvq: convert to new channel layout API
vima: convert to new channel layout API
lavf: Add non diegetic stream disposition flag
channel_layout: add support for Ambisonic
mov: Implement spatial audio support
fftools/cmdutils.c | 42 +-
fftools/cmdutils.h | 8 -
fftools/ffmpeg.c | 47 +-
fftools/ffmpeg.h | 7 +-
fftools/ffmpeg_filter.c | 52 +-
fftools/ffmpeg_opt.c | 62 +-
fftools/ffprobe.c | 19 +-
libavcodec/8svx.c | 19 +-
libavcodec/aac.h | 11 +-
libavcodec/aac_ac3_parser.c | 13 +-
libavcodec/aaccoder.c | 10 +-
libavcodec/aaccoder_twoloop.h | 4 +-
libavcodec/aacdec.c | 6 +
libavcodec/aacdec_fixed.c | 3 +
libavcodec/aacdec_template.c | 52 +-
libavcodec/aacdectab.h | 20 +
libavcodec/aacenc.c | 13 +-
libavcodec/aacenc.h | 64 +-
libavcodec/aacenctab.h | 16 +-
libavcodec/aacpsy.c | 8 +-
libavcodec/ac3dec.c | 57 +-
libavcodec/ac3dec.h | 2 +
libavcodec/ac3dec_fixed.c | 1 +
libavcodec/ac3dec_float.c | 2 +
libavcodec/ac3enc.c | 78 +-
libavcodec/ac3enc.h | 4 +-
libavcodec/ac3enc_fixed.c | 5 +
libavcodec/ac3enc_float.c | 5 +
libavcodec/adpcm.c | 151 ++--
libavcodec/adpcmenc.c | 122 +--
libavcodec/adx.c | 16 +-
libavcodec/adxdec.c | 6 +-
libavcodec/adxenc.c | 11 +-
libavcodec/alac.c | 16 +-
libavcodec/alac_data.c | 20 +-
libavcodec/alac_data.h | 6 +
libavcodec/alacenc.c | 37 +-
libavcodec/alsdec.c | 90 +-
libavcodec/amr_parser.c | 10 +-
libavcodec/amrnbdec.c | 12 +-
libavcodec/amrwbdec.c | 12 +-
libavcodec/apedec.c | 9 +-
libavcodec/aptx.c | 2 +-
libavcodec/aptxdec.c | 8 +-
libavcodec/aptxenc.c | 6 +
libavcodec/atrac1.c | 10 +-
libavcodec/atrac3.c | 41 +-
libavcodec/atrac3plusdec.c | 25 +-
libavcodec/atrac9dec.c | 4 +-
libavcodec/atrac9tab.h | 14 +-
libavcodec/audiotoolboxdec.c | 27 +-
libavcodec/audiotoolboxenc.c | 95 +--
libavcodec/avcodec.c | 53 +-
libavcodec/avcodec.h | 24 +-
libavcodec/binkaudio.c | 19 +-
libavcodec/bmvaudio.c | 4 +-
libavcodec/cngdec.c | 3 +-
libavcodec/cngenc.c | 6 +-
libavcodec/codec.h | 11 +
libavcodec/codec_par.c | 65 +-
libavcodec/codec_par.h | 12 +
libavcodec/cook.c | 25 +-
libavcodec/cook_parser.c | 4 +-
libavcodec/dca_core.c | 6 +-
libavcodec/dca_lbr.c | 13 +-
libavcodec/dca_xll.c | 2 +-
libavcodec/dcadec.c | 63 +-
libavcodec/dcadec.h | 7 +
libavcodec/dcaenc.c | 39 +-
libavcodec/decode.c | 78 +-
libavcodec/dolby_e.c | 52 +-
libavcodec/dolby_e.h | 2 +
libavcodec/dolby_e_parser.c | 11 +-
libavcodec/dpcm.c | 16 +-
libavcodec/dsddec.c | 14 +-
libavcodec/dsicinaudio.c | 4 +-
libavcodec/dss_sp.c | 4 +-
libavcodec/dstdec.c | 8 +-
libavcodec/dvaudiodec.c | 8 +-
libavcodec/eac3enc.c | 5 +
libavcodec/encode.c | 43 +-
libavcodec/evrcdec.c | 4 +-
libavcodec/fastaudio.c | 6 +-
libavcodec/ffwavesynth.c | 6 +-
libavcodec/flac.c | 39 +-
libavcodec/flac.h | 2 +-
libavcodec/flac_parser.c | 7 +-
libavcodec/flacdec.c | 9 +-
libavcodec/flacenc.c | 26 +-
libavcodec/g722dec.c | 4 +-
libavcodec/g722enc.c | 5 +
libavcodec/g723_1_parser.c | 2 +-
libavcodec/g723_1dec.c | 19 +-
libavcodec/g723_1enc.c | 8 +-
libavcodec/g726.c | 8 +-
libavcodec/g729_parser.c | 2 +-
libavcodec/g729dec.c | 20 +-
libavcodec/gsmdec.c | 4 +-
libavcodec/hcadec.c | 16 +-
libavcodec/hcom.c | 2 +-
libavcodec/ilbcdec.c | 4 +-
libavcodec/imc.c | 22 +-
libavcodec/internal.h | 3 +
libavcodec/interplayacm.c | 10 +-
libavcodec/libcelt_dec.c | 10 +-
libavcodec/libcodec2.c | 4 +-
libavcodec/libfdk-aacdec.c | 32 +-
libavcodec/libfdk-aacenc.c | 35 +-
libavcodec/libgsmdec.c | 4 +-
libavcodec/libgsmenc.c | 4 +-
libavcodec/libilbc.c | 6 +-
libavcodec/libmp3lame.c | 9 +-
libavcodec/libopencore-amr.c | 8 +-
libavcodec/libopusdec.c | 39 +-
libavcodec/libopusenc.c | 65 +-
libavcodec/libshine.c | 6 +-
libavcodec/libspeexdec.c | 19 +-
libavcodec/libspeexenc.c | 17 +-
libavcodec/libtwolame.c | 2 +-
libavcodec/libvo-amrwbenc.c | 2 +-
libavcodec/libvorbisdec.c | 4 +-
libavcodec/libvorbisenc.c | 42 +-
libavcodec/mace.c | 15 +-
libavcodec/metasound.c | 31 +-
libavcodec/mfenc.c | 8 +-
libavcodec/mlp.c | 9 +
libavcodec/mlp.h | 5 +
libavcodec/mlp_parser.c | 12 +-
libavcodec/mlpdec.c | 120 ++-
libavcodec/mlpenc.c | 106 +--
libavcodec/mp3_header_decompress_bsf.c | 2 +-
libavcodec/mpc7.c | 7 +-
libavcodec/mpc8.c | 6 +-
libavcodec/mpegaudio_parser.c | 4 +-
libavcodec/mpegaudiodec_template.c | 22 +-
libavcodec/mpegaudioenc_fixed.c | 5 +
libavcodec/mpegaudioenc_float.c | 5 +
libavcodec/mpegaudioenc_template.c | 2 +-
libavcodec/nellymoserdec.c | 4 +-
libavcodec/nellymoserenc.c | 6 +-
libavcodec/on2avc.c | 20 +-
libavcodec/options.c | 2 +
libavcodec/options_table.h | 5 +
libavcodec/opus.c | 73 +-
libavcodec/opusdec.c | 4 +-
libavcodec/opusenc.c | 15 +-
libavcodec/opusenc_psy.c | 20 +-
libavcodec/packet.h | 5 +
libavcodec/pafaudio.c | 5 +-
libavcodec/pcm-bluray.c | 36 +-
libavcodec/pcm-dvd.c | 28 +-
libavcodec/pcm-dvdenc.c | 27 +-
libavcodec/pcm.c | 39 +-
libavcodec/pcm_rechunk_bsf.c | 5 +-
libavcodec/psymodel.c | 8 +-
libavcodec/psymodel.h | 2 +-
libavcodec/pthread_frame.c | 10 +-
libavcodec/qcelpdec.c | 4 +-
libavcodec/qdm2.c | 6 +-
libavcodec/qdmc.c | 9 +-
libavcodec/ra144dec.c | 4 +-
libavcodec/ra144enc.c | 8 +-
libavcodec/ra288.c | 4 +-
libavcodec/ralf.c | 18 +-
libavcodec/roqaudioenc.c | 20 +-
libavcodec/s302m.c | 31 +-
libavcodec/s302menc.c | 18 +-
libavcodec/sbc_parser.c | 8 +-
libavcodec/sbcdec.c | 9 +-
libavcodec/sbcenc.c | 15 +-
libavcodec/shorten.c | 6 +-
libavcodec/sipr.c | 4 +-
libavcodec/siren.c | 4 +-
libavcodec/smacker.c | 12 +-
libavcodec/sonic.c | 14 +-
libavcodec/speexdec.c | 10 +-
libavcodec/takdec.c | 41 +-
libavcodec/truespeech.c | 7 +-
libavcodec/tta.c | 18 +-
libavcodec/ttaenc.c | 14 +-
libavcodec/twinvq.c | 20 +-
libavcodec/twinvqdec.c | 18 +-
libavcodec/utils.c | 24 +-
libavcodec/vima.c | 5 +-
libavcodec/vmdaudio.c | 26 +-
libavcodec/vorbis.h | 3 +
libavcodec/vorbis_data.c | 18 +
libavcodec/vorbisdec.c | 27 +-
libavcodec/vorbisenc.c | 7 +-
libavcodec/wavpack.c | 51 +-
libavcodec/wavpackenc.c | 29 +-
libavcodec/wma.c | 11 +-
libavcodec/wmadec.c | 29 +-
libavcodec/wmaenc.c | 27 +-
libavcodec/wmalosslessdec.c | 13 +-
libavcodec/wmaprodec.c | 30 +-
libavcodec/wmavoice.c | 4 +-
libavcodec/ws-snd1.c | 4 +-
libavdevice/alsa.c | 19 +-
libavdevice/alsa_dec.c | 3 +-
libavdevice/alsa_enc.c | 2 +-
libavdevice/dshow.c | 3 +-
libavdevice/jack.c | 3 +-
libavdevice/lavfi.c | 7 +-
libavdevice/libcdio.c | 5 +-
libavdevice/oss_dec.c | 3 +-
libavdevice/oss_enc.c | 2 +-
libavfilter/aeval.c | 35 +-
libavfilter/af_acontrast.c | 2 +-
libavfilter/af_acrossover.c | 6 +-
libavfilter/af_acrusher.c | 4 +-
libavfilter/af_adeclick.c | 14 +-
libavfilter/af_adecorrelate.c | 12 +-
libavfilter/af_adelay.c | 8 +-
libavfilter/af_adenorm.c | 6 +-
libavfilter/af_aderivative.c | 2 +-
libavfilter/af_adynamicequalizer.c | 6 +-
libavfilter/af_adynamicsmooth.c | 2 +-
libavfilter/af_aecho.c | 8 +-
libavfilter/af_aemphasis.c | 6 +-
libavfilter/af_aexciter.c | 10 +-
libavfilter/af_afade.c | 10 +-
libavfilter/af_afftdn.c | 26 +-
libavfilter/af_afftfilt.c | 30 +-
libavfilter/af_afir.c | 49 +-
libavfilter/af_aformat.c | 33 +-
libavfilter/af_afreqshift.c | 6 +-
libavfilter/af_afwtdn.c | 8 +-
libavfilter/af_agate.c | 14 +-
libavfilter/af_aiir.c | 34 +-
libavfilter/af_alimiter.c | 10 +-
libavfilter/af_amerge.c | 40 +-
libavfilter/af_amix.c | 4 +-
libavfilter/af_amultiply.c | 4 +-
libavfilter/af_anequalizer.c | 14 +-
libavfilter/af_anlmdn.c | 4 +-
libavfilter/af_anlms.c | 6 +-
libavfilter/af_apad.c | 2 +-
libavfilter/af_aphaser.c | 4 +-
libavfilter/af_apsyclip.c | 8 +-
libavfilter/af_apulsator.c | 2 +-
libavfilter/af_aresample.c | 52 +-
libavfilter/af_arnndn.c | 8 +-
libavfilter/af_asdr.c | 8 +-
libavfilter/af_asetnsamples.c | 4 +-
libavfilter/af_ashowinfo.c | 17 +-
libavfilter/af_asoftclip.c | 2 +-
libavfilter/af_aspectralstats.c | 4 +-
libavfilter/af_asr.c | 2 +-
libavfilter/af_astats.c | 10 +-
libavfilter/af_asubboost.c | 8 +-
libavfilter/af_asupercut.c | 6 +-
libavfilter/af_atempo.c | 2 +-
libavfilter/af_atilt.c | 6 +-
libavfilter/af_axcorrelate.c | 8 +-
libavfilter/af_biquads.c | 54 +-
libavfilter/af_bs2b.c | 2 +-
libavfilter/af_channelmap.c | 90 +-
libavfilter/af_channelsplit.c | 42 +-
libavfilter/af_chorus.c | 14 +-
libavfilter/af_compand.c | 14 +-
libavfilter/af_compensationdelay.c | 9 +-
libavfilter/af_crossfeed.c | 2 +-
libavfilter/af_crystalizer.c | 4 +-
libavfilter/af_dcshift.c | 4 +-
libavfilter/af_deesser.c | 6 +-
libavfilter/af_drmeter.c | 4 +-
libavfilter/af_dynaudnorm.c | 24 +-
libavfilter/af_earwax.c | 2 +-
libavfilter/af_extrastereo.c | 2 +-
libavfilter/af_firequalizer.c | 31 +-
libavfilter/af_flanger.c | 6 +-
libavfilter/af_haas.c | 2 +-
libavfilter/af_hdcd.c | 28 +-
libavfilter/af_headphone.c | 40 +-
libavfilter/af_join.c | 270 +++---
libavfilter/af_ladspa.c | 18 +-
libavfilter/af_loudnorm.c | 86 +-
libavfilter/af_lv2.c | 19 +-
libavfilter/af_mcompand.c | 16 +-
libavfilter/af_pan.c | 74 +-
libavfilter/af_replaygain.c | 2 +-
libavfilter/af_rubberband.c | 2 +-
libavfilter/af_sidechaincompress.c | 18 +-
libavfilter/af_silencedetect.c | 8 +-
libavfilter/af_silenceremove.c | 76 +-
libavfilter/af_sofalizer.c | 96 +--
libavfilter/af_speechnorm.c | 28 +-
libavfilter/af_stereotools.c | 2 +-
libavfilter/af_stereowiden.c | 2 +-
libavfilter/af_superequalizer.c | 2 +-
libavfilter/af_surround.c | 90 +-
libavfilter/af_tremolo.c | 2 +-
libavfilter/af_vibrato.c | 6 +-
libavfilter/af_volume.c | 4 +-
libavfilter/af_volumedetect.c | 2 +-
libavfilter/asrc_afirsrc.c | 2 +-
libavfilter/asrc_anoisesrc.c | 2 +-
libavfilter/asrc_anullsrc.c | 13 +-
libavfilter/asrc_flite.c | 6 +-
libavfilter/asrc_hilbert.c | 2 +-
libavfilter/asrc_sinc.c | 2 +-
libavfilter/asrc_sine.c | 2 +-
libavfilter/audio.c | 18 +-
libavfilter/avf_abitscope.c | 10 +-
libavfilter/avf_ahistogram.c | 6 +-
libavfilter/avf_aphasemeter.c | 2 +-
libavfilter/avf_avectorscope.c | 2 +-
libavfilter/avf_concat.c | 2 +-
libavfilter/avf_showcqt.c | 3 +-
libavfilter/avf_showfreqs.c | 4 +-
libavfilter/avf_showspatial.c | 4 +-
libavfilter/avf_showspectrum.c | 15 +-
libavfilter/avf_showvolume.c | 31 +-
libavfilter/avf_showwaves.c | 12 +-
libavfilter/avfilter.c | 21 +-
libavfilter/avfilter.h | 16 +-
libavfilter/avfiltergraph.c | 84 +-
libavfilter/buffersink.c | 36 +-
libavfilter/buffersink.h | 7 +-
libavfilter/buffersrc.c | 94 ++-
libavfilter/buffersrc.h | 9 +
libavfilter/f_ebur128.c | 10 +-
libavfilter/f_graphmonitor.c | 2 +-
libavfilter/f_loop.c | 4 +-
libavfilter/f_reverse.c | 4 +-
libavfilter/f_streamselect.c | 6 +-
libavfilter/formats.c | 151 +++-
libavfilter/formats.h | 16 +-
libavfilter/framepool.c | 5 +
libavfilter/framequeue.c | 4 +-
libavfilter/graphdump.c | 4 +-
libavfilter/internal.h | 2 +-
libavfilter/src_movie.c | 19 +-
libavfilter/tests/filtfmts.c | 3 +-
libavfilter/tests/formats.c | 4 +-
libavfilter/trim.c | 2 +-
libavfilter/vaf_spectrumsynth.c | 2 +-
libavformat/3dostr.c | 13 +-
libavformat/4xm.c | 7 +-
libavformat/aadec.c | 6 +-
libavformat/aaxdec.c | 7 +-
libavformat/acedec.c | 5 +-
libavformat/acm.c | 7 +-
libavformat/act.c | 3 +-
libavformat/adp.c | 3 +-
libavformat/ads.c | 11 +-
libavformat/adxdec.c | 22 +-
libavformat/aea.c | 11 +-
libavformat/afc.c | 5 +-
libavformat/aiffdec.c | 13 +-
libavformat/aiffenc.c | 8 +-
libavformat/aixdec.c | 3 +-
libavformat/alp.c | 16 +-
libavformat/amr.c | 20 +-
libavformat/amvenc.c | 4 +-
libavformat/apc.c | 12 +-
libavformat/ape.c | 3 +-
libavformat/apm.c | 22 +-
libavformat/aptxdec.c | 3 +-
libavformat/argo_asf.c | 18 +-
libavformat/argo_cvg.c | 5 +-
libavformat/astdec.c | 18 +-
libavformat/astenc.c | 4 +-
libavformat/au.c | 9 +-
libavformat/avformat.h | 7 +
libavformat/avr.c | 7 +-
libavformat/bethsoftvid.c | 3 +-
libavformat/bfi.c | 3 +-
libavformat/bink.c | 8 +-
libavformat/binka.c | 3 +-
libavformat/bit.c | 7 +-
libavformat/bmv.c | 3 +-
libavformat/boadec.c | 8 +-
libavformat/brstm.c | 44 +-
libavformat/cafdec.c | 7 +-
libavformat/cafenc.c | 12 +-
libavformat/cdxl.c | 4 +-
libavformat/codec2.c | 3 +-
libavformat/dashenc.c | 2 +-
libavformat/dauddec.c | 3 +-
libavformat/daudenc.c | 2 +-
libavformat/dcstr.c | 15 +-
libavformat/demux.c | 18 +-
libavformat/derf.c | 12 +-
libavformat/dhav.c | 3 +-
libavformat/dsfdec.c | 60 +-
libavformat/dsicin.c | 7 +-
libavformat/dss.c | 3 +-
libavformat/dtshddec.c | 3 +-
libavformat/dump.c | 11 +-
libavformat/dv.c | 3 +-
libavformat/dvenc.c | 2 +-
libavformat/eacdata.c | 22 +-
libavformat/electronicarts.c | 7 +-
libavformat/epafdec.c | 6 +-
libavformat/flacdec.c | 3 +-
libavformat/flacenc.c | 7 +-
libavformat/flic.c | 4 +-
libavformat/flvdec.c | 15 +-
libavformat/flvenc.c | 10 +-
libavformat/framehash.c | 8 +-
libavformat/fsb.c | 36 +-
libavformat/fwse.c | 10 +-
libavformat/g722.c | 2 +-
libavformat/g723_1.c | 3 +-
libavformat/g726.c | 3 +-
libavformat/g729dec.c | 2 +-
libavformat/gdv.c | 6 +-
libavformat/genh.c | 38 +-
libavformat/gsmdec.c | 3 +-
libavformat/gxf.c | 9 +-
libavformat/gxfenc.c | 2 +-
libavformat/hca.c | 3 +-
libavformat/hcom.c | 3 +-
libavformat/hls_sample_encryption.c | 12 +-
libavformat/idcin.c | 4 +-
libavformat/idroqdec.c | 12 +-
libavformat/iff.c | 63 +-
libavformat/ifv.c | 3 +-
libavformat/ilbc.c | 2 +-
libavformat/imx.c | 3 +-
libavformat/ipmovie.c | 8 +-
libavformat/ircamdec.c | 8 +-
libavformat/ircamenc.c | 2 +-
libavformat/isom.c | 5 +-
libavformat/iss.c | 17 +-
libavformat/jvdec.c | 3 +-
libavformat/kvag.c | 19 +-
libavformat/lvfdec.c | 3 +-
libavformat/lxfdec.c | 3 +-
libavformat/matroskadec.c | 8 +-
libavformat/matroskaenc.c | 10 +-
libavformat/mca.c | 25 +-
libavformat/mm.c | 3 +-
libavformat/mmf.c | 5 +-
libavformat/moflex.c | 3 +-
libavformat/mov.c | 176 +++-
libavformat/mov_chan.c | 21 +-
libavformat/mov_chan.h | 3 +-
libavformat/movenc.c | 25 +-
libavformat/mp3enc.c | 2 +-
libavformat/mpc.c | 3 +-
libavformat/mpc8.c | 5 +-
libavformat/mpeg.c | 3 +-
libavformat/mpegenc.c | 10 +-
libavformat/mpegtsenc.c | 30 +-
libavformat/msf.c | 16 +-
libavformat/mtaf.c | 5 +-
libavformat/musx.c | 49 +-
libavformat/mux.c | 19 +-
libavformat/mvdec.c | 10 +-
libavformat/mvi.c | 3 +-
libavformat/mxfdec.c | 34 +-
libavformat/mxfenc.c | 20 +-
libavformat/mxg.c | 3 +-
libavformat/nistspheredec.c | 8 +-
libavformat/nspdec.c | 3 +-
libavformat/nsvdec.c | 2 +-
libavformat/nutdec.c | 5 +-
libavformat/nutenc.c | 4 +-
libavformat/nuv.c | 11 +-
libavformat/oggparsecelt.c | 3 +-
libavformat/oggparseogm.c | 6 +-
libavformat/oggparseopus.c | 3 +-
libavformat/oggparsespeex.c | 8 +-
libavformat/oggparsevorbis.c | 6 +-
libavformat/oma.h | 2 +
libavformat/omadec.c | 35 +-
libavformat/omaenc.c | 4 +-
libavformat/paf.c | 3 +-
libavformat/pcm.c | 2 +-
libavformat/pcmdec.c | 7 +-
libavformat/pmpdec.c | 3 +-
libavformat/pp_bnk.c | 12 +-
libavformat/psxstr.c | 10 +-
libavformat/pvfdec.c | 5 +-
libavformat/qcp.c | 3 +-
libavformat/r3d.c | 3 +-
libavformat/rawenc.c | 2 +-
libavformat/redspark.c | 15 +-
libavformat/riffdec.c | 20 +-
libavformat/riffenc.c | 18 +-
libavformat/rl2.c | 7 +-
libavformat/rmdec.c | 6 +-
libavformat/rmenc.c | 2 +-
libavformat/rpl.c | 7 +-
libavformat/rsd.c | 27 +-
libavformat/rsodec.c | 3 +-
libavformat/rsoenc.c | 2 +-
libavformat/rtp.c | 10 +-
libavformat/rtpdec.c | 4 +-
libavformat/rtpdec_amr.c | 3 +-
libavformat/rtpenc.c | 14 +-
libavformat/rtsp.c | 6 +-
libavformat/rtsp.h | 1 -
libavformat/sbgdec.c | 3 +-
libavformat/scd.c | 9 +-
libavformat/sdp.c | 32 +-
libavformat/sdr2.c | 3 +-
libavformat/sdsdec.c | 3 +-
libavformat/sdxdec.c | 3 +-
libavformat/segafilm.c | 9 +-
libavformat/segafilmenc.c | 2 +-
libavformat/sga.c | 3 +-
libavformat/sierravmd.c | 15 +-
libavformat/siff.c | 3 +-
libavformat/smacker.c | 11 +-
libavformat/smjpegdec.c | 3 +-
libavformat/smjpegenc.c | 2 +-
libavformat/smoothstreamingenc.c | 4 +-
libavformat/smush.c | 4 +-
libavformat/sol.c | 4 +-
libavformat/soxdec.c | 14 +-
libavformat/soxenc.c | 4 +-
libavformat/svag.c | 12 +-
libavformat/svs.c | 3 +-
libavformat/swfdec.c | 8 +-
libavformat/swfenc.c | 2 +-
libavformat/takdec.c | 7 +-
libavformat/tests/movenc.c | 2 +-
libavformat/thp.c | 3 +-
libavformat/tiertexseq.c | 7 +-
libavformat/tmv.c | 10 +-
libavformat/tta.c | 3 +-
libavformat/ttaenc.c | 2 +-
libavformat/uncodedframecrcenc.c | 2 +-
libavformat/utils.c | 13 +-
libavformat/vag.c | 11 +-
libavformat/vividas.c | 8 +-
libavformat/vivo.c | 3 +-
libavformat/voc_packet.c | 9 +-
libavformat/vocenc.c | 9 +-
libavformat/vpk.c | 15 +-
libavformat/vqf.c | 13 +-
libavformat/wavdec.c | 32 +-
libavformat/wavenc.c | 14 +-
libavformat/wc3movie.c | 8 +-
libavformat/westwood_aud.c | 10 +-
libavformat/westwood_audenc.c | 2 +-
libavformat/westwood_vqa.c | 2 +-
libavformat/wsddec.c | 12 +-
libavformat/wtvdec.c | 6 +-
libavformat/wvdec.c | 3 +-
libavformat/wvedec.c | 6 +-
libavformat/xa.c | 9 +-
libavformat/xmv.c | 3 +-
libavformat/xvag.c | 10 +-
libavformat/xwma.c | 10 +-
libavformat/yop.c | 3 +-
libavutil/Makefile | 1 +
libavutil/channel_layout.c | 789 ++++++++++++++++--
libavutil/channel_layout.h | 592 ++++++++++++-
libavutil/frame.c | 116 ++-
libavutil/frame.h | 16 +-
libavutil/opt.c | 126 ++-
libavutil/opt.h | 12 +
libavutil/tests/channel_layout.c | 253 ++++++
libavutil/tests/opt.c | 8 +-
libavutil/version.h | 1 +
libswresample/options.c | 33 +-
libswresample/rematrix.c | 237 ++++--
libswresample/rematrix_template.c | 7 +-
libswresample/swresample.c | 152 +++-
libswresample/swresample.h | 63 ++
libswresample/swresample_frame.c | 65 +-
libswresample/swresample_internal.h | 10 +-
tests/fate/aac.mak | 2 +-
tests/fate/ac3.mak | 16 +-
tests/fate/lavf-container.mak | 2 +-
tests/fate/libavutil.mak | 4 +
tests/ref/fate/8bps | 1 -
tests/ref/fate/aa-demux | 1 -
tests/ref/fate/aac-autobsf-adtstoasc | 1 -
tests/ref/fate/adpcm-4xm | 1 -
tests/ref/fate/adpcm-afc | 1 -
tests/ref/fate/adpcm-dtk | 1 -
tests/ref/fate/adpcm-ea-1 | 1 -
tests/ref/fate/adpcm-ea-2 | 1 -
tests/ref/fate/adpcm-ea-maxis-xa | 1 -
tests/ref/fate/adpcm-ea-r1 | 1 -
tests/ref/fate/adpcm-ima-amv | 1 -
tests/ref/fate/adpcm-ima-ea-eacs | 1 -
tests/ref/fate/adpcm-ima-ea-sead | 1 -
tests/ref/fate/adpcm-ima-smjpeg | 1 -
tests/ref/fate/adpcm-ima-ws | 1 -
tests/ref/fate/adpcm-ima-ws-vqa3 | 1 -
tests/ref/fate/adpcm-ms-mono | 1 -
tests/ref/fate/adpcm-thp | 1 -
tests/ref/fate/adpcm-vima | 1 -
tests/ref/fate/adpcm-xa | 1 -
tests/ref/fate/adts-id3v1-demux | 1 -
tests/ref/fate/adts-id3v2-demux | 1 -
tests/ref/fate/adts-id3v2-two-tags-demux | 1 -
tests/ref/fate/adtstoasc_ticket3715 | 1 -
tests/ref/fate/amrnb-remux | 1 -
tests/ref/fate/amrwb-remux | 1 -
tests/ref/fate/armovie-escape124 | 1 -
tests/ref/fate/bethsoft-vid | 1 -
tests/ref/fate/bfi | 1 -
tests/ref/fate/bmv-audio | 1 -
tests/ref/fate/caf-alac-remux | 1 -
tests/ref/fate/caf-amr_nb-remux | 1 -
tests/ref/fate/caf-mace6-remux | 1 -
tests/ref/fate/caf-pcm_s24-remux | 1 -
tests/ref/fate/caf-pcm_s24le-remux | 1 -
tests/ref/fate/caf-qdm2-remux | 1 -
tests/ref/fate/cdxl-demux | 1 -
tests/ref/fate/channel_layout | 111 +++
tests/ref/fate/copy-psp | 1 -
tests/ref/fate/copy-shortest1 | 1 -
tests/ref/fate/copy-shortest2 | 1 -
tests/ref/fate/copy-trac236 | 1 -
tests/ref/fate/copy-trac3074 | 1 -
tests/ref/fate/copy-trac4914 | 1 -
tests/ref/fate/copy-trac4914-avi | 1 -
tests/ref/fate/corepng | 1 -
tests/ref/fate/cover-art-aiff-id3v2-remux | 1 -
tests/ref/fate/cover-art-flac-remux | 6 +-
tests/ref/fate/cover-art-mp3-id3v2-remux | 1 -
tests/ref/fate/creatureshock-avs | 1 -
tests/ref/fate/cyberia-c93 | 1 -
tests/ref/fate/d-cinema-demux | 1 -
tests/ref/fate/dca-xll_51_16_192_768_0 | 1 -
tests/ref/fate/dca-xll_51_16_192_768_0-dmix_2 | 1 -
tests/ref/fate/dca-xll_51_16_192_768_0-dmix_6 | 1 -
tests/ref/fate/dca-xll_51_16_192_768_1 | 1 -
tests/ref/fate/dca-xll_51_16_192_768_1-dmix_2 | 1 -
tests/ref/fate/dca-xll_51_16_192_768_1-dmix_6 | 1 -
tests/ref/fate/dca-xll_51_24_48_768 | 1 -
tests/ref/fate/dca-xll_51_24_48_768-dmix_2 | 1 -
tests/ref/fate/dca-xll_51_24_48_768-dmix_6 | 1 -
tests/ref/fate/dca-xll_51_24_48_none | 1 -
tests/ref/fate/dca-xll_51_24_48_none-dmix_2 | 1 -
tests/ref/fate/dca-xll_51_24_48_none-dmix_6 | 1 -
tests/ref/fate/dca-xll_71_24_48_768_0 | 1 -
tests/ref/fate/dca-xll_71_24_48_768_0-dmix_2 | 1 -
tests/ref/fate/dca-xll_71_24_48_768_0-dmix_6 | 1 -
tests/ref/fate/dca-xll_71_24_48_768_1 | 1 -
tests/ref/fate/dca-xll_71_24_48_768_1-dmix_2 | 1 -
tests/ref/fate/dca-xll_71_24_48_768_1-dmix_6 | 1 -
tests/ref/fate/dca-xll_71_24_96_768 | 1 -
tests/ref/fate/dca-xll_71_24_96_768-dmix_2 | 1 -
tests/ref/fate/dca-xll_71_24_96_768-dmix_6 | 1 -
tests/ref/fate/dca-xll_x96_51_24_96_1509 | 1 -
.../ref/fate/dca-xll_x96_51_24_96_1509-dmix_2 | 1 -
.../ref/fate/dca-xll_x96_51_24_96_1509-dmix_6 | 1 -
tests/ref/fate/dca-xll_xch_61_24_48_768 | 1 -
.../ref/fate/dca-xll_xch_61_24_48_768-dmix_2 | 1 -
.../ref/fate/dca-xll_xch_61_24_48_768-dmix_6 | 1 -
tests/ref/fate/dcinema-encode | 1 -
tests/ref/fate/delphine-cin-audio | 1 -
tests/ref/fate/dpcm-idroq | 1 -
tests/ref/fate/dpcm-interplay | 1 -
tests/ref/fate/dss-lp | 1 -
tests/ref/fate/dss-sp | 1 -
tests/ref/fate/ffmpeg-attached_pics | 1 -
tests/ref/fate/ffmpeg-filter_complex_audio | 1 -
tests/ref/fate/filter-acrossfade | 1 -
tests/ref/fate/filter-adelay | 1 -
tests/ref/fate/filter-aecho | 1 -
tests/ref/fate/filter-aemphasis | 2 -
tests/ref/fate/filter-aemphasis-50fm | 1 -
tests/ref/fate/filter-aemphasis-75kf | 1 -
tests/ref/fate/filter-afade-esin | 1 -
tests/ref/fate/filter-afade-exp | 1 -
tests/ref/fate/filter-afade-hsin | 1 -
tests/ref/fate/filter-afade-iqsin | 1 -
tests/ref/fate/filter-afade-log | 1 -
tests/ref/fate/filter-afade-qsin | 1 -
tests/ref/fate/filter-agate | 1 -
tests/ref/fate/filter-alimiter | 1 -
tests/ref/fate/filter-amerge | 1 -
tests/ref/fate/filter-anequalizer | 1 -
tests/ref/fate/filter-apad | 1 -
tests/ref/fate/filter-asetnsamples-nopad | 1 -
tests/ref/fate/filter-asetnsamples-pad | 1 -
tests/ref/fate/filter-asetrate | 1 -
tests/ref/fate/filter-atrim-duration | 1 -
tests/ref/fate/filter-atrim-mixed | 1 -
tests/ref/fate/filter-atrim-samples | 1 -
tests/ref/fate/filter-atrim-time | 1 -
tests/ref/fate/filter-chorus | 1 -
tests/ref/fate/filter-compand | 1 -
tests/ref/fate/filter-concat | 1 -
tests/ref/fate/filter-concat-vfr | 1 -
tests/ref/fate/filter-dcshift | 1 -
tests/ref/fate/filter-earwax | 1 -
tests/ref/fate/filter-extrastereo | 1 -
tests/ref/fate/filter-formats | 20 +-
tests/ref/fate/filter-hls | 1 -
tests/ref/fate/filter-hls-append | 1 -
tests/ref/fate/filter-meta-4560-rotate0 | 1 -
tests/ref/fate/filter-overlay-dvdsub-2397 | 1 -
tests/ref/fate/filter-pan-downmix1 | 1 -
tests/ref/fate/filter-pan-downmix2 | 1 -
tests/ref/fate/filter-pan-mono1 | 1 -
tests/ref/fate/filter-pan-mono2 | 1 -
tests/ref/fate/filter-pan-stereo1 | 1 -
tests/ref/fate/filter-pan-stereo2 | 1 -
tests/ref/fate/filter-pan-stereo3 | 1 -
tests/ref/fate/filter-pan-stereo4 | 1 -
tests/ref/fate/filter-pan-upmix1 | 1 -
tests/ref/fate/filter-pan-upmix2 | 1 -
tests/ref/fate/filter-silenceremove | 1 -
tests/ref/fate/filter-stereotools | 1 -
tests/ref/fate/g722-encode | 1 -
tests/ref/fate/g722dec-1 | 1 -
tests/ref/fate/g723_1-dec-1 | 1 -
tests/ref/fate/g723_1-dec-2 | 1 -
tests/ref/fate/g723_1-dec-3 | 1 -
tests/ref/fate/g723_1-dec-4 | 1 -
tests/ref/fate/g723_1-dec-5 | 1 -
tests/ref/fate/g723_1-dec-6 | 1 -
tests/ref/fate/g723_1-dec-7 | 1 -
tests/ref/fate/g723_1-dec-8 | 1 -
tests/ref/fate/g726-encode-2bit | 1 -
tests/ref/fate/g726-encode-3bit | 1 -
tests/ref/fate/g726-encode-4bit | 1 -
tests/ref/fate/g726-encode-5bit | 1 -
tests/ref/fate/gapless-mp3 | 6 +-
tests/ref/fate/gsm-ms | 1 -
tests/ref/fate/gsm-toast | 1 -
tests/ref/fate/h264-skip-nointra | 1 -
tests/ref/fate/h264-skip-nokey | 1 -
tests/ref/fate/h264-xavc-4389 | 1 -
tests/ref/fate/hls-fmp4 | 1 -
tests/ref/fate/hls-init-time | 1 -
tests/ref/fate/hls-list-size | 1 -
tests/ref/fate/hls-segment-single | 1 -
tests/ref/fate/hls-segment-size | 1 -
tests/ref/fate/id-cin-video | 1 -
tests/ref/fate/id3v2-chapters | 1 -
tests/ref/fate/id3v2-priv-remux | 1 -
tests/ref/fate/jv-demux | 1 -
tests/ref/fate/lmlm4-demux | 1 -
tests/ref/fate/matroska-flac-channel-mapping | 2 -
tests/ref/fate/matroska-flac-extradata-update | 3 -
tests/ref/fate/matroska-lzo-decompression | 1 -
.../fate/matroska-mastering-display-metadata | 2 -
tests/ref/fate/matroska-mpegts-remux | 2 -
.../matroska-wavpack-missing-codecprivate | 1 -
tests/ref/fate/matroska-xiph-lacing | 1 -
tests/ref/fate/maxis-xa | 1 -
tests/ref/fate/mkv | 1 -
tests/ref/fate/mkv-1242 | 1 -
tests/ref/fate/mov-440hz-10ms | 1 -
tests/ref/fate/mov-bbi-elst-starts-b | 1 -
tests/ref/fate/mov-cover-image | 1 -
tests/ref/fate/mov-mp3-demux | 1 -
.../ref/fate/mov-mp4-disposition-mpegts-remux | 2 -
tests/ref/fate/mpegps-remuxed-pcm-demux | 1 -
tests/ref/fate/mtv | 1 -
tests/ref/fate/mxf-demux | 1 -
tests/ref/fate/nsv-demux | 1 -
tests/ref/fate/oma-atrac3-remux | 1 -
tests/ref/fate/oma-atrac3p-remux | 1 -
tests/ref/fate/on2avc | 1 -
tests/ref/fate/opt | 16 +-
tests/ref/fate/paf-audio | 1 -
tests/ref/fate/paf-demux | 1 -
tests/ref/fate/pcm-planar | 1 -
tests/ref/fate/pcm_dvd | 1 -
tests/ref/fate/pmp-demux | 1 -
tests/ref/fate/prores-gray | 1 -
tests/ref/fate/prores-transparency | 1 -
tests/ref/fate/prores-transparency_skip | 1 -
tests/ref/fate/psx-str-demux | 1 -
tests/ref/fate/pva-demux | 1 -
tests/ref/fate/ra3-144 | 1 -
tests/ref/fate/redcode-demux | 1 -
tests/ref/fate/s337m-demux | 1 -
tests/ref/fate/segment-adts-to-mkv-header-000 | 1 -
tests/ref/fate/segment-adts-to-mkv-header-001 | 1 -
tests/ref/fate/segment-adts-to-mkv-header-002 | 1 -
tests/ref/fate/segment-adts-to-mkv-header-all | 1 -
tests/ref/fate/shortest | 1 -
tests/ref/fate/sierra-vmd-audio | 1 -
tests/ref/fate/siff-demux | 1 -
tests/ref/fate/smacker-audio | 1 -
tests/ref/fate/smjpeg-demux | 1 -
tests/ref/fate/sp5x | 1 -
tests/ref/fate/tiertex-seq | 1 -
tests/ref/fate/tmv | 1 -
tests/ref/fate/tscc-15bit | 1 -
tests/ref/fate/vqf-demux | 2 +-
tests/ref/fate/wav-ac3 | 1 -
tests/ref/fate/wc3movie-xan | 1 -
tests/ref/fate/webm-dash-chapters | 1 -
tests/ref/fate/westwood-aud | 1 -
tests/ref/fate/wmv3-drm-nodec | 1 -
tests/ref/fate/wtv-demux | 1 -
tests/ref/fate/xmv-demux | 1 -
793 files changed, 7311 insertions(+), 3936 deletions(-)
create mode 100644 libavutil/tests/channel_layout.c
create mode 100644 tests/ref/fate/channel_layout
--
2.34.1
8
336
[PATCH 01/17] avformat/mxfenc: Auto-insert h264_mp4toannexb BSF if needed
by Andreas Rheinhardt 04 Mar '22
by Andreas Rheinhardt 04 Mar '22
04 Mar '22
The mxf and mxf_opatom muxer expect H.264 in Annex B format.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt(a)outlook.com>
---
The check here is taken from mpegtsenc.
libavformat/mxfenc.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index c36ebef932..d1c4d43a50 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -3174,6 +3174,22 @@ static int mxf_interleave(AVFormatContext *s, AVPacket *pkt,
return mxf_interleave_get_packet(s, pkt, flush);
}
+static int mxf_check_bitstream(AVFormatContext *s, const AVPacket *pkt)
+{
+ AVStream *const st = s->streams[pkt->stream_index];
+
+ switch (st->codecpar->codec_id) {
+ case AV_CODEC_ID_H264:
+ if (pkt->size >= 5 && AV_RB32(pkt->data) != 0x0000001 &&
+ (AV_RB24(pkt->data) != 0x000001 ||
+ (st->codecpar->extradata_size > 0 &&
+ st->codecpar->extradata[0] == 1)))
+ return ff_stream_add_bitstream_filter(st, "h264_mp4toannexb", NULL);
+ break;
+ }
+ return 1;
+}
+
#define MXF_COMMON_OPTIONS \
{ "signal_standard", "Force/set Signal Standard",\
offsetof(MXFContext, signal_standard), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 7, AV_OPT_FLAG_ENCODING_PARAM, "signal_standard"},\
@@ -3249,6 +3265,7 @@ const AVOutputFormat ff_mxf_muxer = {
.audio_codec = AV_CODEC_ID_PCM_S16LE,
.video_codec = AV_CODEC_ID_MPEG2VIDEO,
.write_header = mxf_write_header,
+ .check_bitstream = mxf_check_bitstream,
.write_packet = mxf_write_packet,
.write_trailer = mxf_write_footer,
.deinit = mxf_deinit,
@@ -3282,6 +3299,7 @@ const AVOutputFormat ff_mxf_opatom_muxer = {
.audio_codec = AV_CODEC_ID_PCM_S16LE,
.video_codec = AV_CODEC_ID_DNXHD,
.write_header = mxf_write_header,
+ .check_bitstream = mxf_check_bitstream,
.write_packet = mxf_write_packet,
.write_trailer = mxf_write_footer,
.deinit = mxf_deinit,
--
2.30.2
4
45
Signed-off-by: Michael Niedermayer <michael(a)niedermayer.cc>
---
libavcodec/ac3dec.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index a95c204..499971a 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -426,6 +426,10 @@ static int decode_exponents(AC3DecodeContext *s,
group_size = exp_strategy + (exp_strategy == EXP_D45);
for (grp = 0, i = 0; grp < ngrps; grp++) {
expacc = get_bits(gbc, 7);
+ if (expacc >= 125) {
+ av_log(s->avctx, AV_LOG_ERROR, "expacc %d is out-of-range\n", expacc);
+ return AVERROR_INVALIDDATA;
+ }
dexp[i++] = ungroup_3_in_7_bits_tab[expacc][0];
dexp[i++] = ungroup_3_in_7_bits_tab[expacc][1];
dexp[i++] = ungroup_3_in_7_bits_tab[expacc][2];
--
2.10.2
3
4
As per discussion on the list (
https://ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281513.html, see
especially https://ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281586.html)
to resolve the the unholy ABI-relationship between libavdevice and
libavformat and allow easier working on the part of the avdevice API
that lives in avformat, lock avdevice to a specific major and minor
version of avformat.
Signed-off-by: Diederick Niehorster <dcnieho(a)gmail.com>
---
libavdevice/avdevice.c | 10 ++++++++++
libavdevice/version.h | 10 ++++++++++
libavformat/utils.c | 5 +++++
libavformat/version.h | 11 +++++++++++
libavutil/macros.h | 3 +++
5 files changed, 39 insertions(+)
diff --git a/libavdevice/avdevice.c b/libavdevice/avdevice.c
index 8f460c7564..0c9b702eda 100644
--- a/libavdevice/avdevice.c
+++ b/libavdevice/avdevice.c
@@ -38,6 +38,16 @@ unsigned avdevice_version(void)
return LIBAVDEVICE_VERSION_INT;
}
+unsigned avdevice_version_same_minor()
+{
+ // check version of loaded lavf has same major and minor version as
+ // this library was compiled against
+ if ((avformat_version_same_minor()) & ~0xFF != (LIBAVFORMAT_VERSION_INT & ~0xFF))
+ abort();
+
+ return avdevice_version();
+}
+
const char * avdevice_configuration(void)
{
return FFMPEG_CONFIGURATION;
diff --git a/libavdevice/version.h b/libavdevice/version.h
index 41f568d6b0..83d8c67511 100644
--- a/libavdevice/version.h
+++ b/libavdevice/version.h
@@ -26,6 +26,7 @@
*/
#include "libavutil/version.h"
+#include "libavutil/macros.h"
#define LIBAVDEVICE_VERSION_MAJOR 59
#define LIBAVDEVICE_VERSION_MINOR 1
@@ -48,4 +49,13 @@
*/
#define FF_API_DEVICE_CAPABILITIES (LIBAVDEVICE_VERSION_MAJOR < 60)
+/**
+ * avdevice_version_same_minor() expands to a function with
+ * the same minor and major version it was compiled against
+ * encoded in it. Enables locking to the minor version of
+ * other libraries they were compiled against.
+ */
+#define avdevice_version_same_minor AV_MAKE_MAJOR_MINOR_FUNC_NAME(device,LIBAVFORMAT_VERSION_MAJOR,LIBAVFORMAT_VERSION_MINOR)
+unsigned avdevice_version_same_minor();
+
#endif /* AVDEVICE_VERSION_H */
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 332ba534d2..607a777c3f 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -63,6 +63,11 @@ unsigned avformat_version(void)
return LIBAVFORMAT_VERSION_INT;
}
+unsigned avformat_version_same_minor()
+{
+ return avformat_version();
+}
+
const char *avformat_configuration(void)
{
return FFMPEG_CONFIGURATION;
diff --git a/libavformat/version.h b/libavformat/version.h
index 379a68cc7c..661d074b12 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -28,6 +28,7 @@
*/
#include "libavutil/version.h"
+#include "libavutil/macros.h"
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
// Also please add any ticket numbers that you believe might be affected here
@@ -63,4 +64,14 @@
#define FF_API_R_FRAME_RATE 1
+
+/**
+ * avformat_version_same_minor() expands to a function with
+ * the same minor and major version it was compiled against
+ * encoded in it. Enables locking to the minor version of
+ * other libraries they were compiled against.
+ */
+#define avformat_version_same_minor AV_MAKE_MAJOR_MINOR_FUNC_NAME(format,LIBAVFORMAT_VERSION_MAJOR,LIBAVFORMAT_VERSION_MINOR)
+unsigned avformat_version_same_minor();
+
#endif /* AVFORMAT_VERSION_H */
diff --git a/libavutil/macros.h b/libavutil/macros.h
index 2a7567c3ea..dab530a8a0 100644
--- a/libavutil/macros.h
+++ b/libavutil/macros.h
@@ -73,6 +73,9 @@
* @}
*/
+#define AV_MAKE_MAJOR_MINOR_FUNC_NAME_IMPL(name,major,minor) av ## name ## _version_ ## major ## _ ## minor
+#define AV_MAKE_MAJOR_MINOR_FUNC_NAME(name,major,minor) AV_MAKE_MAJOR_MINOR_FUNC_NAME_IMPL(name,major,minor)
+
#define AV_PRAGMA(s) _Pragma(#s)
#define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1))
--
2.28.0.windows.1
3
4
Modified the function av_find_best_stream() such that, when a list of
allowed codecs is supplied in the format context, and when the caller is
requesting a decoder be returned, the function will select the best
stream that has a decoder in the allowed decoders list.
Signed-off-by: Eric Juteau <ericjut(a)outlook.com>
---
libavformat/utils.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavformat/utils.c b/libavformat/utils.c
index e643821fc9..5a96f16c0f 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -529,7 +529,8 @@ int av_find_best_stream(AVFormatContext *ic, enum AVMediaType type,
continue;
if (decoder_ret) {
decoder = ff_find_decoder(ic, st, par->codec_id);
- if (!decoder) {
+ if ((!decoder) ||
+ (ic->codec_whitelist && av_match_list(decoder->name, ic->codec_whitelist, ',') <= 0)) {
if (ret < 0)
ret = AVERROR_DECODER_NOT_FOUND;
continue;
--
2.25.1
1
1
[PATCH v1 0/4] Supplement AVS3-P2/IEEE1857.10 video decoding via libuavs3d
by hwrenx@126.com 26 Feb '22
by hwrenx@126.com 26 Feb '22
26 Feb '22
From: hwren <hwrenx(a)126.com>
These patches are to supplement the third generation of Audio Video Coding Standard,
part 2: video (AVS3-P2), aka IEEE1857.10, decoding support via libuavs3d wrapper.
The uAVS3d decoder could be found in https://github.com/uavs3/uavs3d
AVS3 sample streams could be found in https://github.com/uavs3/avs3stream
hwren (4):
lavc: add AVS3 codec id and desc
lavc/avs3_paeser: add avs3 parser
lavf/avs3dec: add raw avs3 demuxer
lavc,doc: add libuavs3d video decoder wrapper
Changelog | 1 +
configure | 4 +
doc/decoders.texi | 21 ++++
doc/general.texi | 8 ++
libavcodec/Makefile | 2 +
libavcodec/allcodecs.c | 1 +
libavcodec/avs3_parser.c | 184 ++++++++++++++++++++++++++++++
libavcodec/codec_desc.c | 7 ++
libavcodec/codec_id.h | 1 +
libavcodec/libuavs3d.c | 283 +++++++++++++++++++++++++++++++++++++++++++++++
libavcodec/parsers.c | 1 +
libavformat/Makefile | 1 +
libavformat/allformats.c | 1 +
libavformat/avs3dec.c | 79 +++++++++++++
14 files changed, 594 insertions(+)
create mode 100644 libavcodec/avs3_parser.c
create mode 100644 libavcodec/libuavs3d.c
create mode 100644 libavformat/avs3dec.c
--
2.7.4
11
78
24 Feb '22
From: Suji Velupillai <suji.velupillai(a)broadcom.com>
Initial commit to add VKAPI hardware accelerator implementation.
The depedency component vkil source code can be obtained from github
https://github.com/Broadcom/vkil
Signed-off-by: Suji Velupillai <suji.velupillai(a)broadcom.com>
---
configure | 8 +-
doc/APIchanges | 4 +
libavutil/Makefile | 2 +
libavutil/hwcontext.c | 4 +
libavutil/hwcontext.h | 1 +
libavutil/hwcontext_internal.h | 1 +
libavutil/hwcontext_vkapi.c | 522 +++++++++++++++++++++++++++++++++
libavutil/hwcontext_vkapi.h | 104 +++++++
libavutil/pixdesc.c | 4 +
libavutil/pixfmt.h | 6 +
10 files changed, 655 insertions(+), 1 deletion(-)
create mode 100644 libavutil/hwcontext_vkapi.c
create mode 100644 libavutil/hwcontext_vkapi.h
diff --git a/configure b/configure
index d11942fced..73eb4539ee 100755
--- a/configure
+++ b/configure
@@ -348,6 +348,7 @@ External library support:
--disable-vaapi disable Video Acceleration API (mainly Unix/Intel) code [autodetect]
--disable-vdpau disable Nvidia Video Decode and Presentation API for Unix code [autodetect]
--disable-videotoolbox disable VideoToolbox code [autodetect]
+ --disable-vkapi disable VKAPI code [autodetect]
Toolchain options:
--arch=ARCH select architecture [$arch]
@@ -1844,6 +1845,7 @@ HWACCEL_AUTODETECT_LIBRARY_LIST="
vaapi
vdpau
videotoolbox
+ vkapi
v4l2_m2m
xvmc
"
@@ -2919,6 +2921,7 @@ nvdec_deps="ffnvcodec"
vaapi_x11_deps="xlib"
videotoolbox_hwaccel_deps="videotoolbox pthreads"
videotoolbox_hwaccel_extralibs="-framework QuartzCore"
+vkapi_deps="libvkil"
xvmc_deps="X11_extensions_XvMClib_h"
av1_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_AV1"
@@ -3708,7 +3711,7 @@ avformat_deps="avcodec avutil"
avformat_suggest="libm network zlib"
avresample_deps="avutil"
avresample_suggest="libm"
-avutil_suggest="clock_gettime ffnvcodec libm libdrm libmfx opencl user32 vaapi vulkan videotoolbox corefoundation corevideo coremedia bcrypt"
+avutil_suggest="clock_gettime ffnvcodec libm libdrm libmfx opencl user32 vaapi vulkan vkapi videotoolbox corefoundation corevideo coremedia bcrypt"
postproc_deps="avutil gpl"
postproc_suggest="libm"
swresample_deps="avutil"
@@ -6734,6 +6737,9 @@ enabled vdpau &&
enabled vdpau &&
check_lib vdpau_x11 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau -lX11
+enabled vkapi &&
+ check_lib libvkil vkil_api.h vkil_create_api -lvkil
+
enabled crystalhd && check_lib crystalhd "stdint.h libcrystalhd/libcrystalhd_if.h" DtsCrystalHDVersion -lcrystalhd
enabled vulkan &&
diff --git a/doc/APIchanges b/doc/APIchanges
index 13350c0db0..ccab2e6465 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,10 @@ libavutil: 2017-10-21
API changes, most recent first:
+2021-03-11 - xxxxxxxxxx - lavu yy.yy.yyy - hwcontext.h
+ Add AV_PIX_FMT_VKAPI
+ Add AV_HWDEVICE_TYPE_VKAPI and implementation.
+
2021-03-10 - xxxxxxxxxx - lavf 58.72.100 - avformat.h
Change AVBufferRef related AVStream function and struct size
parameter and fields type to size_t at next major bump.
diff --git a/libavutil/Makefile b/libavutil/Makefile
index 27bafe9e12..4044b133a3 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -45,6 +45,7 @@ HEADERS = adler32.h \
hwcontext_vaapi.h \
hwcontext_videotoolbox.h \
hwcontext_vdpau.h \
+ hwcontext_vkapi.h \
hwcontext_vulkan.h \
imgutils.h \
intfloat.h \
@@ -185,6 +186,7 @@ OBJS-$(CONFIG_QSV) += hwcontext_qsv.o
OBJS-$(CONFIG_VAAPI) += hwcontext_vaapi.o
OBJS-$(CONFIG_VIDEOTOOLBOX) += hwcontext_videotoolbox.o
OBJS-$(CONFIG_VDPAU) += hwcontext_vdpau.o
+OBJS-$(CONFIG_VKAPI) += hwcontext_vkapi.o
OBJS-$(CONFIG_VULKAN) += hwcontext_vulkan.o
OBJS += $(COMPAT_OBJS:%=../compat/%)
diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
index d13d0f7c9b..4c13db6578 100644
--- a/libavutil/hwcontext.c
+++ b/libavutil/hwcontext.c
@@ -59,6 +59,9 @@ static const HWContextType * const hw_table[] = {
#if CONFIG_MEDIACODEC
&ff_hwcontext_type_mediacodec,
#endif
+#if CONFIG_VKAPI
+ &ff_hwcontext_type_vkapi,
+#endif
#if CONFIG_VULKAN
&ff_hwcontext_type_vulkan,
#endif
@@ -76,6 +79,7 @@ static const char *const hw_type_names[] = {
[AV_HWDEVICE_TYPE_VDPAU] = "vdpau",
[AV_HWDEVICE_TYPE_VIDEOTOOLBOX] = "videotoolbox",
[AV_HWDEVICE_TYPE_MEDIACODEC] = "mediacodec",
+ [AV_HWDEVICE_TYPE_VKAPI] = "vkapi",
[AV_HWDEVICE_TYPE_VULKAN] = "vulkan",
};
diff --git a/libavutil/hwcontext.h b/libavutil/hwcontext.h
index 04d19d89c2..b862f45aa3 100644
--- a/libavutil/hwcontext.h
+++ b/libavutil/hwcontext.h
@@ -36,6 +36,7 @@ enum AVHWDeviceType {
AV_HWDEVICE_TYPE_DRM,
AV_HWDEVICE_TYPE_OPENCL,
AV_HWDEVICE_TYPE_MEDIACODEC,
+ AV_HWDEVICE_TYPE_VKAPI,
AV_HWDEVICE_TYPE_VULKAN,
};
diff --git a/libavutil/hwcontext_internal.h b/libavutil/hwcontext_internal.h
index e6266494ac..c5270759a4 100644
--- a/libavutil/hwcontext_internal.h
+++ b/libavutil/hwcontext_internal.h
@@ -173,6 +173,7 @@ extern const HWContextType ff_hwcontext_type_vaapi;
extern const HWContextType ff_hwcontext_type_vdpau;
extern const HWContextType ff_hwcontext_type_videotoolbox;
extern const HWContextType ff_hwcontext_type_mediacodec;
+extern const HWContextType ff_hwcontext_type_vkapi;
extern const HWContextType ff_hwcontext_type_vulkan;
#endif /* AVUTIL_HWCONTEXT_INTERNAL_H */
diff --git a/libavutil/hwcontext_vkapi.c b/libavutil/hwcontext_vkapi.c
new file mode 100644
index 0000000000..089b0a47d6
--- /dev/null
+++ b/libavutil/hwcontext_vkapi.c
@@ -0,0 +1,522 @@
+/*
+ * Copyright (c) 2018 Broadcom
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avassert.h"
+#include "buffer.h"
+#include "buffer_internal.h"
+#include "common.h"
+#include "hwcontext.h"
+#include "hwcontext_internal.h"
+#include "hwcontext_vkapi.h"
+#include "imgutils.h"
+#include "mem.h"
+#include "pixdesc.h"
+#include "pixfmt.h"
+
+#define VKAPI_FRAME_ALIGNMENT 256
+
+static const enum AVPixelFormat supported_formats[] = {
+ AV_PIX_FMT_NV12,
+ AV_PIX_FMT_NV21,
+ AV_PIX_FMT_P010,
+ AV_PIX_FMT_P016,
+ AV_PIX_FMT_VKAPI,
+ AV_PIX_FMT_NONE,
+};
+
+/**
+ * Check if the format fmt is in an array
+ *
+ * @param fmt the format to check if exists
+ * @param fmts the array to check the format
+ * @return 1 if format is presnet in an array, 0 otherwise
+ */
+static int vkapi_fmt_is_in(int fmt, const int *fmts)
+{
+ const int *p;
+
+ for (p = fmts; *p != -1; p++) {
+ if (fmt == *p)
+ return 1;
+ }
+
+ return 0;
+}
+
+/**
+ * Convert the pixel format from the AVPixelFormat to a vk_format_type
+ * equivalent.
+ *
+ * @param pixel_format an AVPixelFormat
+ * @return a vkil_format_type if match found, otherwise return an error code
+ */
+static int vkapi_av2vk_fmt(enum AVPixelFormat pixel_format)
+{
+ switch (pixel_format) {
+ case AV_PIX_FMT_NV12:
+ return VK_FORMAT_NV12;
+ case AV_PIX_FMT_NV21:
+ return VK_FORMAT_NV21;
+ case AV_PIX_FMT_P010:
+ return VK_FORMAT_P010;
+ case AV_PIX_FMT_VKAPI:
+ return VK_FORMAT_YOL2;
+ default:
+ return AVERROR(EINVAL);
+ }
+}
+
+/**
+ * Provide the number of buffer currently referenced in the hardware pool
+ *
+ * @param ctx the hardware frames context
+ * @return number of buffer in use in the internal pool
+ */
+static int vkapi_get_pool_occupancy(AVHWFramesContext *ctx)
+{
+ int val = atomic_load(&ctx->internal->pool_internal->refcount);
+
+ return (val - 1);
+}
+
+/**
+ * Get the reference on the frame hwprops
+ *
+ * @param frame the ffmpeg AVFrame structure
+ * @param phw_surface_desc vkil buffer surface associated with the AVFrame
+ * @return 0 if succesfull, otherwise return an error code
+ */
+static int vkapi_frame_ref_hwprops(const AVFrame *frame, void *phw_surface_desc)
+{
+ void **hw_surface_desc = phw_surface_desc;
+
+ if (frame->format != AV_PIX_FMT_VKAPI)
+ return AVERROR_BUG;
+
+ *hw_surface_desc = frame->data[3];
+
+ if (!(*hw_surface_desc))
+ return AVERROR_BUG;
+
+ return 0;
+}
+
+/**
+ * Set a ffmpeg AVFrame with the vkil buffer surface properties
+ *
+ * @param frame the ffmpeg AVFrame structure
+ * @param hw_surface_desc the vkil buffer surface to be associated with the AVFrame
+ * @return 0 if succesfull, otherwise return an error code
+ */
+static int vkapi_frame_set_hwprops(AVFrame *frame,
+ const vkil_buffer_surface *hw_surface_desc)
+{
+ if (frame->format != AV_PIX_FMT_VKAPI)
+ return AVERROR_BUG;
+
+ // vkil buffer surface description is stored in ffmpeg AVframe:data[3]
+ av_assert0(frame->data[3]);
+
+ // the "hard copy" only the buffer descriptor
+ memcpy((vkil_buffer_surface *)frame->data[3], hw_surface_desc,
+ sizeof(vkil_buffer_surface));
+
+ return 0;
+}
+
+/**
+ * Retrieve vkil buffer surface properties associated with an ffmpeg AVFrame
+ *
+ * @param frame the ffmpeg AVFrame structure
+ * @param hw_surface_desc a vkil buffer surface, where where to extract the property
+ * @return 0 if succesfull, otherwise return an error code
+ */
+static int vkapi_frame_get_hwprops(const AVFrame *frame,
+ vkil_buffer_surface *hw_surface_desc)
+{
+ if (frame->format != AV_PIX_FMT_VKAPI)
+ return AVERROR_BUG;
+
+ // the frame is hw tunneled (hw format)
+ // vkil buffer surface description is stored in ffmpeg AVframe:data[3]
+ av_assert0(frame->data[3]);
+
+ // the "hard copy" only the buffer descriptor
+ memcpy(hw_surface_desc, (vkil_buffer_surface *)frame->data[3],
+ sizeof(vkil_buffer_surface));
+
+ return 0;
+}
+
+static void vkapi_pool_release(void *opaque, uint8_t *data)
+{
+ av_free(data);
+}
+
+static AVBufferRef *vkapi_pool_alloc(void *opaque, int size)
+{
+ AVHWFramesContext *ctx = opaque;
+ AVBufferRef *ret_ptr = NULL;
+ vkil_buffer_surface *hw_surface_desc;
+
+ hw_surface_desc = av_mallocz(sizeof(vkil_buffer_surface));
+ if (!hw_surface_desc) {
+ av_log(hw_surface_desc, AV_LOG_ERROR, "av_mallocz failed\n");
+ goto out;
+ }
+
+ ret_ptr = av_buffer_create((uint8_t *)hw_surface_desc,
+ sizeof(*hw_surface_desc), vkapi_pool_release,
+ NULL, AV_BUFFER_FLAG_READONLY);
+ if (!ret_ptr) {
+ av_log(ctx, AV_LOG_ERROR, "av_buffer_create failed\n");
+ av_free(hw_surface_desc);
+ }
+
+out:
+ return ret_ptr;
+}
+
+static int vkapi_frames_init(AVHWFramesContext *ctx)
+{
+ int aligned_width = FFALIGN(ctx->width, VKAPI_FRAME_ALIGNMENT);
+ int ret = AVERROR(EINVAL);
+ int valid_format = vkapi_fmt_is_in(ctx->sw_format, supported_formats);
+ VKAPIFramesContext *vk_framectx = ctx->hwctx;
+
+ if (!valid_format)
+ goto fail;
+
+ // set default VKAPIFramesContext
+ vk_framectx->color.range = AVCOL_RANGE_UNSPECIFIED;
+ vk_framectx->color.primaries = AVCOL_PRI_UNSPECIFIED;
+ vk_framectx->color.trc = AVCOL_TRC_UNSPECIFIED;
+ vk_framectx->color.space = AVCOL_SPC_UNSPECIFIED;
+
+ if (!ctx->pool) {
+ int size;
+
+ switch (ctx->sw_format) {
+ case AV_PIX_FMT_VKAPI:
+ size = sizeof(void *);
+ break;
+ case AV_PIX_FMT_NV12:
+ case AV_PIX_FMT_NV21:
+ size = (aligned_width * ctx->height * 3) >> 1;
+ break;
+ case AV_PIX_FMT_P010:
+ case AV_PIX_FMT_P016:
+ size = aligned_width * ctx->height * 3;
+ break;
+ default:
+ goto fail;
+ }
+
+ ctx->internal->pool_internal = av_buffer_pool_init2(size, ctx, vkapi_pool_alloc, NULL);
+ if (!ctx->internal->pool_internal) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+ }
+
+ return 0;
+
+fail:
+ av_log(ctx, AV_LOG_ERROR, "vkapi_frames_init failed on error %d\n", ret);
+ return ret;
+
+}
+
+static int vkapi_get_buffer(AVHWFramesContext *ctx, AVFrame *frame)
+{
+ int ret = 0;
+
+ frame->buf[0] = av_buffer_pool_get(ctx->pool);
+ if (!frame->buf[0]) {
+ av_log(ctx, AV_LOG_ERROR, "av_buffer_pool_get failed\n");
+ ret = AVERROR(ENOMEM);
+ } else {
+ // vkil data are stored in frame->data[3]
+ frame->data[3] = frame->buf[0]->data;
+ frame->format = AV_PIX_FMT_VKAPI;
+ frame->width = ctx->width;
+ frame->height = ctx->height;
+ }
+
+ return ret;
+}
+
+static int vkapi_transfer_get_formats(AVHWFramesContext *ctx,
+ enum AVHWFrameTransferDirection dir,
+ enum AVPixelFormat **formats)
+{
+ enum AVPixelFormat *fmts;
+ int ret = 0;
+
+ // this allocation freed in hwcontext::transfer_data_alloc
+ fmts = av_malloc_array(2, sizeof(*fmts));
+ if (!fmts) {
+ av_log(ctx, AV_LOG_ERROR, "vkapi_transfer_get_formats failed\n");
+ ret = AVERROR(ENOMEM);
+ } else {
+ fmts[0] = ctx->sw_format;
+ fmts[1] = AV_PIX_FMT_NONE;
+ *formats = fmts;
+ }
+
+ return ret;
+}
+
+static int vkapi_convert_AV2VK_Frame(vkil_buffer_surface *dst,
+ const AVFrame *src)
+{
+ int i;
+
+ av_assert0(src->interlaced_frame == 0);
+
+ dst->max_size.width = src->width;
+ dst->max_size.height = src->height;
+ dst->format = vkapi_av2vk_fmt(src->format);
+ dst->quality = src->quality;
+ dst->prefix.type = VKIL_BUF_SURFACE;
+ dst->prefix.port_id = 0; // set to default (first port)
+ dst->prefix.flags = 0; // other fields set to zero (default value)
+
+ for (i = 0; i < VKIL_BUF_NPLANES; i++) {
+ dst->plane_top[i] = src->data[i];
+ dst->plane_bot[i] = src->data[i + VKIL_BUF_NPLANES];
+ dst->stride[i] = src->linesize[i];
+ // sanity check: vk structure requires 32 bits alignment
+ if (((uintptr_t)dst->plane_top[i] & (VKIL_BUF_ALIGN -1)) ||
+ ((uintptr_t)dst->plane_bot[i] & (VKIL_BUF_ALIGN -1)) ||
+ (dst->stride[i] &(VKIL_BUF_ALIGN -1)))
+ return AVERROR(EINVAL);
+ }
+
+ return 0;
+}
+
+static int vkapi_transfer_data_from(AVHWFramesContext *ctx, AVFrame *dst,
+ const AVFrame *src)
+{
+ int ret;
+ int32_t size;
+ VKAPIFramesContext *hw_framectx;
+ AVHWFramesContext *avhw_framectx;
+ VKAPIDeviceContext *hw_devicectx;
+ vkil_buffer_surface *surface;
+ vkil_buffer metadata;
+
+ hw_devicectx = ctx->device_ctx->hwctx;
+
+ av_assert0(src->hw_frames_ctx->data);
+ avhw_framectx = (AVHWFramesContext *)src->hw_frames_ctx->data;
+
+ av_assert0(avhw_framectx->hwctx);
+ hw_framectx = avhw_framectx->hwctx;
+ vkapi_frame_ref_hwprops(src, &surface);
+
+ // populate the vkil_surface structure with the destination pointer on the host
+ vkapi_convert_AV2VK_Frame(surface, dst);
+
+ // blocking call as ffmpeg assume the transfer is complete on return
+ ret = hw_devicectx->ilapi->transfer_buffer2(hw_framectx->ilctx, surface,
+ VK_CMD_DOWNLOAD | VK_CMD_OPT_BLOCKING,
+ &size);
+ if (ret < 0)
+ goto fail;
+
+
+ if (src->data[VKAPI_METADATA_PLANE]) {
+ // Dereference if any transferred frame that has an associated metadata buffer
+ // no need to transfer it back to host
+ metadata.handle = (uint32_t)src->data[VKAPI_METADATA_PLANE];
+ metadata.type = VKIL_BUF_META_DATA;
+ metadata.ref = 1;
+ ret = hw_devicectx->ilapi->xref_buffer(hw_framectx->ilctx, &metadata, -1,
+ VK_CMD_RUN | VK_CMD_OPT_BLOCKING);
+ if (ret)
+ goto fail;
+ }
+
+ return 0;
+
+fail:
+ av_log(ctx, AV_LOG_ERROR, "failure %d on vkapi_transfer_data_to\n", ret);
+ return AVERROR(EINVAL);
+}
+
+static int vkapi_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst,
+ const AVFrame *src)
+{
+ int ret;
+ int32_t i, size = 0;
+ VKAPIFramesContext *hw_framectx;
+ AVHWFramesContext *avhw_framectx;
+ VKAPIDeviceContext *hw_devicectx;
+ vkil_buffer_surface *surface;
+ vkil_context *ilctx;
+ uint8_t *tmp_data[4] = {NULL, NULL, NULL, NULL};
+ int linesize[4];
+
+ av_assert0(VKIL_BUF_NPLANES * 2 <= 4);
+
+ hw_devicectx = ctx->device_ctx->hwctx;
+
+ av_assert0(dst->hw_frames_ctx->data);
+ avhw_framectx = (AVHWFramesContext *)dst->hw_frames_ctx->data;
+
+ av_assert0(avhw_framectx->hwctx);
+ hw_framectx = avhw_framectx->hwctx;
+
+ ret = vkapi_frame_ref_hwprops(dst, &surface);
+ if (ret < 0) {
+ ret = AVERROR(EINVAL);
+ goto fail;
+ }
+
+ // populate the vkil_surface structure with the origin pointer on the host
+ ret = vkapi_convert_AV2VK_Frame(surface, src);
+ if (ret) {
+ ret = av_image_alloc(tmp_data, linesize, src->width, src->height,
+ src->format, VKIL_BUF_ALIGN);
+ if (ret < 0)
+ goto fail;
+
+ av_image_copy(tmp_data, linesize, (const uint8_t **)src->data,
+ src->linesize, src->format, src->width, src->height);
+
+ for (i = 0; i < VKIL_BUF_NPLANES; i++) {
+ surface->plane_top[i]= tmp_data[i];
+ surface->plane_bot[i]= tmp_data[VKIL_BUF_NPLANES + i];
+ surface->stride[i] = linesize[i];
+ }
+ }
+
+ surface->quality = dst->quality;
+
+ ilctx = hw_framectx->ilctx;
+ if (!ilctx) {
+ ret = AVERROR(EINVAL);
+ goto fail;
+ }
+
+ // blocking call as ffmpeg assumes the transfer is complete on return
+ ret = hw_devicectx->ilapi->transfer_buffer2(ilctx, surface,
+ VK_CMD_UPLOAD | VK_CMD_OPT_BLOCKING,
+ &size);
+ if (ret < 0) {
+ ret = AVERROR(EINVAL);
+ goto fail;
+ }
+
+ hw_framectx->handle = surface->prefix.handle;
+
+ if (tmp_data[0])
+ av_free(tmp_data[0]);
+
+ return 0;
+
+fail:
+ if (tmp_data[0])
+ av_free(tmp_data[0]);
+
+ av_log(ctx, AV_LOG_ERROR, "failure %d on vkapi_transfer_data_to\n", ret);
+ return ret;
+}
+
+static void vkapi_device_uninit(AVHWDeviceContext *ctx)
+{
+ VKAPIDeviceContext *hwctx;
+
+ av_assert0(ctx);
+ av_assert0(ctx->hwctx);
+
+ hwctx = ctx->hwctx;
+
+ if (hwctx->ilapi)
+ vkil_destroy_api((void **)&hwctx->ilapi);
+}
+
+static int vkapi_device_init(AVHWDeviceContext *ctx)
+{
+ VKAPIDeviceContext *hwctx;
+ int ret = AVERROR_EXTERNAL;
+
+ av_assert0(ctx);
+ av_assert0(ctx->hwctx);
+
+ hwctx = ctx->hwctx;
+ hwctx->frame_set_hwprops = vkapi_frame_set_hwprops;
+ hwctx->frame_get_hwprops = vkapi_frame_get_hwprops;
+ hwctx->frame_ref_hwprops = vkapi_frame_ref_hwprops;
+ hwctx->fmt_is_in = vkapi_fmt_is_in;
+ hwctx->av2vk_fmt = vkapi_av2vk_fmt;
+ hwctx->get_pool_occupancy = vkapi_get_pool_occupancy;
+
+ if (!(hwctx->ilapi = vkil_create_api())) {
+ av_log(ctx, AV_LOG_ERROR, "ctx->ilapi failed to be created\n");
+ goto out;
+ }
+
+ if (!hwctx->ilapi->init) {
+ av_log(ctx, AV_LOG_ERROR, "ctx->ilapi not properly initialized\n");
+ goto out;
+ }
+
+ ret = 0;
+
+out:
+ if (ret)
+ vkapi_device_uninit(ctx);
+
+ return ret;
+}
+
+static int vkapi_device_create(AVHWDeviceContext *ctx, const char *device,
+ AVDictionary *opts, int flags)
+{
+ /* nothing to do at this time */
+ return 0;
+}
+
+const HWContextType ff_hwcontext_type_vkapi = {
+ .type = AV_HWDEVICE_TYPE_VKAPI,
+ .name = "VKAPI",
+
+ .device_hwctx_size = sizeof(VKAPIDeviceContext),
+ .frames_hwctx_size = sizeof(VKAPIFramesContext),
+
+ .device_create = vkapi_device_create,
+ .device_init = vkapi_device_init,
+ .device_uninit = vkapi_device_uninit,
+
+ .frames_init = vkapi_frames_init,
+ .frames_get_buffer = vkapi_get_buffer,
+
+ .transfer_get_formats = vkapi_transfer_get_formats,
+ .transfer_data_to = vkapi_transfer_data_to,
+ .transfer_data_from = vkapi_transfer_data_from,
+
+ .pix_fmts = (const enum AVPixelFormat[]) {
+ AV_PIX_FMT_VKAPI,
+ AV_PIX_FMT_NONE
+ },
+};
diff --git a/libavutil/hwcontext_vkapi.h b/libavutil/hwcontext_vkapi.h
new file mode 100644
index 0000000000..096602b42e
--- /dev/null
+++ b/libavutil/hwcontext_vkapi.h
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2018 Broadcom
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General 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_HWCONTEXT_VKAPI_H
+#define AVUTIL_HWCONTEXT_VKAPI_H
+
+#include <vkil_api.h>
+
+#define VKAPI_METADATA_PLANE 4
+
+/**
+ * @file
+ * API-specific header for AV_HWDEVICE_TYPE_VKAPI.
+ */
+
+/**
+ * Allocated as AVHWDeviceContext.hwctx
+ */
+typedef struct VKAPIDeviceContext {
+ /**
+ * Holds pointers to hardware specific functions
+ */
+ vkil_api *ilapi;
+ /**
+ * Internal functions definitions
+ */
+ /**
+ * Get the hwprops reference from the AVFrame:data[3]
+ */
+ int (*frame_ref_hwprops)(const AVFrame *frame, void *phw_surface_desc);
+ /**
+ * Set the hwprops into AVFrame:data[3]
+ */
+ int (*frame_set_hwprops)(AVFrame *frame, const vkil_buffer_surface *hw_surface_desc);
+ /**
+ * Get the hwprops from AVFrame:data[3]
+ */
+ int (*frame_get_hwprops)(const AVFrame *frame, vkil_buffer_surface *hw_surface_desc);
+ /**
+ * Check if format is in an array
+ */
+ int (*fmt_is_in)(int fmt, const int *fmts);
+ /**
+ * Convert AVPixelFormat to VKAPI equivalent pixel format
+ */
+ int (*av2vk_fmt)(enum AVPixelFormat pixel_format);
+ /**
+ * Get no of buffer count reference in the hardware pool
+ */
+ int (*get_pool_occupancy)(AVHWFramesContext *ctx);
+} VKAPIDeviceContext;
+
+/**
+ * Contains color information for hardware
+ */
+typedef struct VKAPIColorContext {
+ enum AVColorRange range;
+ enum AVColorPrimaries primaries;
+ enum AVColorTransferCharacteristic trc;
+ enum AVColorSpace space;
+ enum AVChromaLocation chroma_location;
+} VKAPIColorContext;
+
+/**
+ * Allocated as AVHWFramesContext.hwctx
+ */
+typedef struct VKAPIFramesContext {
+ /**
+ * Handle to a hardware frame context
+ */
+ uint32_t handle;
+ /**
+ * Hardware component port associated to the frame context
+ */
+ uint32_t port_id;
+ uint32_t extra_port_id;
+ /**
+ * Color information
+ */
+ VKAPIColorContext color;
+ /**
+ * ilcontext associated to the frame context
+ */
+ vkil_context *ilctx;
+} VKAPIFramesContext;
+
+#endif /* AVUTIL_HWCONTEXT_VKAPI_H */
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 2a919461a5..1d2f242e57 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -2391,6 +2391,10 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
+ [AV_PIX_FMT_VKAPI] = {
+ .name = "vkapi",
+ .flags = AV_PIX_FMT_FLAG_HWACCEL,
+ },
[AV_PIX_FMT_VULKAN] = {
.name = "vulkan",
.flags = AV_PIX_FMT_FLAG_HWACCEL,
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 46ef211add..3ae607a3d6 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -348,6 +348,12 @@ enum AVPixelFormat {
AV_PIX_FMT_NV24, ///< planar YUV 4:4:4, 24bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
AV_PIX_FMT_NV42, ///< as above, but U and V bytes are swapped
+ /**
+ * VKAPI hardware acceleration.
+ * data[3] contains a pointer to the vkil_buffer_surface structure
+ */
+ AV_PIX_FMT_VKAPI,
+
/**
* Vulkan hardware images.
*
--
2.17.1
8
14
[PATCH 1/7] avformat/vivo: Do not use the general expression evaluator for parsing a floating point value
by Michael Niedermayer 19 Feb '22
by Michael Niedermayer 19 Feb '22
19 Feb '22
Fixes: Timeout
Fixes: 41564/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVO_fuzzer-6309014024093696
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael(a)niedermayer.cc>
---
libavformat/vivo.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/libavformat/vivo.c b/libavformat/vivo.c
index b2904cd25a7..8e819d910b7 100644
--- a/libavformat/vivo.c
+++ b/libavformat/vivo.c
@@ -206,11 +206,12 @@ static int vivo_read_header(AVFormatContext *s)
return AVERROR_INVALIDDATA;
value_used = 1;
} else if (!strcmp(key, "FPS")) {
- AVRational tmp;
+ double d;
+ if (sscanf(value, "%f", &d) != 1)
+ return AVERROR_INVALIDDATA;
value_used = 1;
- if (!av_parse_ratio(&tmp, value, 10000, AV_LOG_WARNING, s))
- fps = av_inv_q(tmp);
+ fps = av_d2q(1/d, 10000);
}
if (!value_used)
--
2.17.1
6
19
[PATCH 1/4] avcodec/adpcm_psx: always fetch next byte irregardless of flag
by Zane van Iperen 15 Feb '22
by Zane van Iperen 15 Feb '22
15 Feb '22
Even though all samples are meant to be zero (if flag == 0x07),
doesn't mean that they aren't there. See No$PSX docs [1].
[1]: https://problemkaputt.de/psx-spx.htm#spuadpcmsamples
Signed-off-by: Zane van Iperen <zane(a)zanevaniperen.com>
---
libavcodec/adpcm.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 3da6b734cf..8c07f3673d 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -1990,14 +1990,14 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
for (n = 0; n < 28; n++) {
int sample = 0, scale;
- if (flag < 0x07) {
- if (n & 1) {
- scale = sign_extend(byte >> 4, 4);
- } else {
- byte = bytestream2_get_byteu(&gb);
- scale = sign_extend(byte, 4);
- }
+ if (n & 1) {
+ scale = sign_extend(byte >> 4, 4);
+ } else {
+ byte = bytestream2_get_byteu(&gb);
+ scale = sign_extend(byte, 4);
+ }
+ if (flag < 0x07) {
scale = scale * (1 << 12);
sample = (int)((scale >> shift) + (c->status[channel].sample1 * xa_adpcm_table[filter][0] + c->status[channel].sample2 * xa_adpcm_table[filter][1]) / 64);
}
--
2.29.3
2
8