Commit Graph

106773 Commits

Author SHA1 Message Date
Gyan Doshi 1405b65d22 avfilter/lensfun: add option db_path
The lensfun filter, at present, loads its database from a path hardcoded
at build time. This may not be known or available to end users.

Added option db_path allows custom path.
2022-04-12 15:20:10 +05:30
Paul B Mahol 1047fedd0f avfilter: add Audio Video Sync Test filter
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2022-04-12 10:51:46 +02:00
Martin Storsjö 74439b67f2 tests: Fix the dependencies for the fate-jpg-icc test
The test also requires a png decoder, which often can be disabled in
cross building setups, where zlib might be missing.

Signed-off-by: Martin Storsjö <martin@martin.st>
2022-04-12 09:06:07 +03:00
Paul B Mahol 13fe148c31 avfilter/f_ebur128: fix typos for swr chlayouts 2022-04-11 23:14:54 +02:00
Andreas Rheinhardt 3bbbb09a53 avcodec/hevc_sei: Don't use GetBit-API for byte-aligned reads
Instead use the bytestream2-API.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-11 19:19:50 +02:00
Andreas Rheinhardt cf3f8ab9e6 avcodec/hevc_sei: Fix parsing SEI messages
SEI messages are naturally byte-aligned by adding padding bits
to achieve byte-alignment. The parsing code in libavcodec/hevc_sei.c
nevertheless uses a GetBitContext to read it. When doing so, parsing
the next SEI message starts exactly at the position where reading
the last message (if any) ended.

This means that one would have to handle both the payload extension data
(which makes most SEI messages extensible structs) as well as the
padding bits for byte-alignment. Yet our SEI parsing code in
libavcodec/hevc_sei.c does not read these at all. Instead several of
the functions used for parsing specific SEI messages use
skip_bits_long(); some don't use it at all, in which case it is possible
for the GetBitContext to not be byte-aligned at the start of the next
SEI message (the parsing code for several types of SEI messages relies
on byte-alignment).

Fix this by always using a dedicated GetBitContext per SEI message;
skipping the necessary amount of bytes in the NALU context
is done at a higher level. This also allows to remove unnecessary
parsing code that only existed in order to skip enough bytes.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-11 19:19:50 +02:00
Niklas Haas e254af3154 avcodec/mjpegenc: support writing ICC profiles
This is mostly straightforward. The major complication is that, as a
result of the 16-bit chunk size limitation, ICC profiles may need to be
split up into multiple chunks.

We also need to make sure to allocate enough extra space in the packet
to fit the ICC profile, so modify both mpegvideo_enc.c and ljpegenc.c to
take into account this extra overhead, failing cleanly if necessary.

Also add a FATE transcode test to ensure that the ICC profile gets
written (and read) correctly. Note that this ICC profile is smaller than
64 kB, so this doesn't test the APP2 chunk re-arranging code at all.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-04-11 17:29:57 +02:00
Niklas Haas 4a580975d4 avcodec/pngenc: support writing iCCP chunks
We re-use the PNGEncContext.zstream for deflate-related operations.
Other than that, the code is pretty straightforward. Special care needs
to be taken to avoid writing more than 79 characters of the profile
description (the maximum supported).

To write the (dynamically sized) deflate-encoded data, we allocate extra
space in the packet and use that directly as a scratch buffer. Modify
png_write_chunk slightly to allow pre-writing the chunk contents like
this.

Also add a FATE transcode test to ensure that the ICC profile gets
encoded correctly.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-04-11 17:29:57 +02:00
Gyan Doshi d6d46a2c50 doc/filters: guide to list lensfun db emtries 2022-04-11 16:15:22 +05:30
Mark Thompson 9f02e03387 vaapi_encode_h265: Query encoding block sizes and features
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2022-04-11 11:38:43 +08:00
Mark Thompson 77fd2f9c7c vaapi_encode_h265: Explicitly set and correct some flags
max_14bit_constraint_flag should be set if the bit depth is not greater than
14 (currently always true).

one_picture_only_flag should not be set because we don't support the still
picture profiles.

general_profile_compatibility_flag should be set according to general_profile_idc
instead of bit depth.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2022-04-11 11:38:43 +08:00
Mark Thompson 99b333e5ff vaapi_encode: Move block size calculation after entrypoint selection
The block size can be dependent on the profile and entrypoint selected.
It defaults to 16x16, with codecs able to override this choice with their
own function.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2022-04-11 11:38:43 +08:00
Linjie Fu a285968a0b lavc/vaapi_encode_h265: Add GPB frame support for hevc_vaapi
Use GPB frames to replace regular P/B frames if backend driver does not
support it.

- GPB:
    Generalized P and B picture. Regular P/B frames replaced by B
    frames with previous-predict only, L0 == L1. Normal B frames
    still have 2 different ref_lists and allow bi-prediction

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2022-04-11 11:38:43 +08:00
Paul B Mahol 6e45acd23b avfilter: let single output frame A->V filters set reasonable frame rate 2022-04-10 22:41:26 +02:00
Marton Balint 7ac559b819 fate: add fate tests for VBN encoder and decoder
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-10 20:12:23 +02:00
Marton Balint ee50cc18b3 avcodec/vbnenc: add VBN encoder
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-10 20:12:23 +02:00
Marton Balint 013d774e22 avcodec/vbndec: add VBN decoder
Add support for decoding Vizrt Binary Image (VBN) files.

LZW-compressed data is not supported yet.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-10 20:12:23 +02:00
Marton Balint a4570d7a66 avcodec/hapenc: use the common texturedsp encode function
And add slice thread capabilities.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-10 20:12:23 +02:00
Marton Balint b3074ac9f4 avcodec/hapdec: use the common texturedsp decode function
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-10 20:12:23 +02:00
Marton Balint 30fdcd2e12 avcodec/dds: use the common texture dsp decode function
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-10 20:12:23 +02:00
Marton Balint 541d3755e9 avcodec/texturedsp: add TextureDSPThreadContext for common decode/encode function
This will allow using a common threaded decode or encode function from most
codecs using texture DSP functions.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-10 20:12:23 +02:00
Marton Balint 80e997b081 fate/filter-refcmp-*: make refcmp_metadata fail on empty or truncated input
On empty input the awk script was always successful which caused the
filter-refcmp tests to always succeed.

Also fix the command lines for refcmp_metadata compare function because it
needs auto conversion filters, and update reference of test
filter-refcmp-psnr-rgb because it was missed in
a7fc78c1a6 but was never noticed due to the
original issue...

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-10 20:12:23 +02:00
Peter Ross 072101bd52 avcodec/binkaudio: fix indentation to match previous line
Signed-off-by: Peter Ross <pross@xvid.org>
2022-04-10 10:45:02 +10:00
Andrey Volk 4e6debe1df avcodec/libwebpenc_animencoder: Fix memory leak of WebPData in libwebp_anim_encode_frame()
Signed-off-by: Andrey Volk <andywolk@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-10 01:13:19 +02:00
Romain Beauxis 2a44db59ca avdevice/dshow: Fix dshow device name/description
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-09 21:29:39 +02:00
Peter Ross 7f534d022e avformat/codec2: remove surplus include 'memory.h' statement
on glibc memory.h drags in string.h, but codec2 does not use any
str* or mem* functions. additionally, memory.h is not part of the
C99 or POSIX standards.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-09 21:05:18 +02:00
TADANO Tokumei ad063e6e10 avformat/mpegts.c: ignore a section with next flag
'current_next_indicator' of 0 (next) on each section header indicates
the service information is for immediate future one.
ffmpeg doesn't need to parse it but current (1) one.

ref: section 5.1.1 of DVB BlueBook A038 (EN 300 468)

Signed-off-by: TADANO Tokumei <aimingoff@pc.nifty.jp>
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-09 20:23:45 +02:00
TADANO Tokumei 5dcedfcd17 avformat/mpegts.c: fix to check end of each descriptor of SDT
Current code incorrectly check against end of section rather than
end of descriptor.

Signed-off-by: TADANO Tokumei <aimingoff@pc.nifty.jp>
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-09 19:58:53 +02:00
softworkz 58b07ecb3f avcodec/dvdsubdec: fix incorrect yellow appearance of dvd subtitles
The guess_palette() implementation is questionable in itself
as its results don't match those from other DVD subtitle decoders.

This commit starts cleanup by fixing an obvious bug which has made
certain DVD subs appear yellow instead of white or grey for more than
10 years..

Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: rcombs <rcombs@rcombs.me>
2022-04-09 04:45:28 -05:00
James Almer aa0829d834 fate: update reference files after the recent dash manifest muxer changes
Missed in 487b49d8f2.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-04-08 16:08:53 -03:00
Paul B Mahol 5a9de38e54 avfilter/vf_waveform: copy props from input frame 2022-04-08 18:54:00 +02:00
Paul B Mahol a700dc3735 avfilter/vf_waveform: add some support for commands 2022-04-08 18:54:00 +02:00
Paul B Mahol e528ced7c8 avfilter/vf_vectorscope: add some commands support 2022-04-08 18:54:00 +02:00
Paul B Mahol 49526852c3 avfilter/vf_drawbox: add packed rgb support 2022-04-08 12:17:26 +02:00
Paul B Mahol 8d6acba59a avfilter/vf_colorkey: use multiplication instead of division 2022-04-08 10:16:59 +02:00
Paul B Mahol c3f5f1bc56 avfilter/vf_colorkey: add >8 depth support 2022-04-08 10:02:33 +02:00
Paul B Mahol 9d20f64f9c avformat/smacker: add better seeking support 2022-04-08 10:02:33 +02:00
Haihao Xiang b2dd3e844d qsvenc: fix typo
Reviewed-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-04-08 11:16:29 +08:00
James Almer 487b49d8f2 avformat/webmdashenc: fix on-demand profile string
Fixes ticket #9596

Signed-off-by: James Almer <jamrial@gmail.com>
2022-04-07 21:57:42 -03:00
James Almer 3e186148ca avcodec/libdav1d: don't depend on the event flags API to init sequence params the first time
A bug was found in dav1d <= 1.0.0 where the event flag New Sequence Header would
not be signaled for some samples using delayed random access points.
It has since been fixed, but nonetheless it's best to ensure the AVCodecContext
is filled with parameters when parsing the first frame, regardless of what events
were signaled.

Fixes ticket #9694.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-04-07 15:28:50 -03:00
James Almer e3c4442b24 avcodec/libsvtav1: give svtav1-params priority over avctx values
If the svt equivalent option to an avctx AVOption is passed by the user
then it should have priority. The exception are fields like dimensions, bitdepth
and pixel format, which must match what lavc will feed the encoder after init.

This addresses libsvt-av1 issue #1858.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-04-07 12:15:39 -03:00
Hendrik Leppkes cd96211ace avfilter/f_ebur128: multiply in integer first, before dividing in float
Restores the order of operations from before 15a1104, which reduces
errors from floating point calculations, and fixes FATE on mingw64.
2022-04-07 16:37:51 +02:00
Gyan Doshi 607ecc27ed doc/filters: add range/defaults for tile filter options 2022-04-07 15:56:43 +05:30
Paul B Mahol 55d414829c avfilter/af_ladspa: fix pts compensation if number of samples per frame is lower than latency 2022-04-07 09:39:55 +02:00
Paul B Mahol 4fbf3c828b avfilter/af_ladspa: compensate output pts if latency compensation is on 2022-04-06 16:59:45 +02:00
Wenbin Chen fb88809063 libavcodec/qsvenc: Add more pixel format support to qsvenc
Qsv encoder only support input P010 and nv12 format directly from system
memory. For other format, we need to upload frame to device memory and
input qsv format to encoder. Now add other system memory format support
to qsv encoder.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2022-04-06 17:12:26 +08:00
Wenbin Chen e0ae810da3 libavcodec/qsvdec: Add more pixel format support to qsvdec
Qsv decoder only supports directly output nv12 and p010 to system
memory. For other format, we need to download frame from qsv format
to system memory. Now add other supported format to qsvdec.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2022-04-06 17:12:26 +08:00
Wenbin Chen 0a0847dbac libavcodec/qsvdec: using suggested num to set init_pool_size
The init_pool_size is set to be 64 and it is too many.
Use IOSurfQuery to get NumFrameSuggest which is the suggested
number of frame that needed to be allocated when initializing the decoder.
Considering that the hevc_qsv encoder uses the  most frame buffer,
async is 4 (default) and max_b_frames is 8 (default) and decoder
may followed by VPP, use NumFrameSuggest + 16 to set init_pool_size.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Guangxin Xu <guangxin.xu@intel.com>
2022-04-06 17:12:26 +08:00
Wenbin Chen 4a633eb36f libavcodec/qsvdec: remove redundant decodeHeader()
Since ffmpeg-qsv uses return value to reinit decoder, it doesn't need to
decode header each time. Move qsv_decode_header's position so that
it will be called only if codec needed to be reinitialized.
Rearrange the code of flushing decoder and re-init decoder operation.
Remove the buffer_count and use the got_frame to decide whether the
decoder is drain.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Guangxin Xu <guangxin.xu@intel.com>
2022-04-06 17:12:26 +08:00
Wenbin Chen 40f38659d7 libavcodec/qsvdec: reinit decoder according to decode() return value
FFmpeg-qsv decoder reinit codec when width and height change, but there
are not only resolution change need to reinit codec. I change it to use
return value from DecodeFrameAsync() to decide whether decoder need to
be reinitialized.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Guangxin Xu <guangxin.xu@intel.com>
2022-04-06 17:12:26 +08:00