Re: [FFmpeg-devel] [PATCH 2/2] avformat/matroskadec: adjust the cluster time to the track timebase

2020-11-19 Thread Anton Khirnov
Quoting Steve Lhomme (2020-11-15 09:59:48) > The Block timestamp read in matroska_parse_block() is in track timebase and is > passed on as such to the AVPacket which uses this timebase. > > In the normal case the Cluster and Track timebases are the same because the > track->time_scale is 1.0. But

Re: [FFmpeg-devel] [PATCH] avformat/matroskadec: only use the track duration if it exists

2020-11-19 Thread Anton Khirnov
Quoting Steve Lhomme (2020-11-15 10:00:35) > No need to multiplying/dividing when we know it's zero. > --- > libavformat/matroskadec.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > Looks reasonable -- Anton Khirnov ___ ffmpeg-devel m

[FFmpeg-devel] [PATCH] Moves yuv2yuvX_sse3 to yasm, unrolls main loop and other small optimizations for ~20% speedup.

2020-11-19 Thread Alan Kelly
--- All of Henrik's suggestions have been implemented. Additionally, m3 and m6 are permuted in avx2 before storing to ensure bit by bit identical results in avx2. libswscale/x86/Makefile | 1 + libswscale/x86/swscale.c| 75 +++ libswscale/x86/yuv2yuvX.asm | 118 ++

Re: [FFmpeg-devel] [PATCH] avcodec: add SpeedHQ encoder

2020-11-19 Thread Paul B Mahol
Will apply soon. On Mon, Nov 9, 2020 at 4:22 PM Paul B Mahol wrote: > > > On Mon, Nov 9, 2020 at 4:11 PM Derek Buitenhuis < > derek.buitenh...@gmail.com> wrote: > >> On 09/11/2020 12:02, Paul B Mahol wrote: >> > +.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, >> >> I think you can add FF_CODEC

Re: [FFmpeg-devel] [PATCH 5/6] avcodec/wavpack: use av_buffer_replace() to simplify code

2020-11-19 Thread James Almer
On 11/19/2020 4:40 AM, Anton Khirnov wrote: Quoting Gil Pedersen (2020-11-18 14:05:16) Signed-off-by: Gil Pedersen --- libavcodec/wavpack.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index f77548e5a5..58122c948c 1006

Re: [FFmpeg-devel] [PATCH 6/6] avutil/frame: use av_buffer_replace() to simplify code

2020-11-19 Thread James Almer
On 11/19/2020 4:38 AM, Anton Khirnov wrote: Quoting Gil Pedersen (2020-11-18 14:05:17) Also fixes potential leaks in failing av_frame_ref(). Signed-off-by: Gil Pedersen --- Looks ok Split in two and applied. ___ ffmpeg-devel mailing list ffmpeg-d

Re: [FFmpeg-devel] [PATCH 1/3] tools/target_dec_fuzzer: Call avcodec_flush_buffers() in a fuzzer choosen pattern

2020-11-19 Thread James Almer
On 11/14/2020 10:29 PM, James Almer wrote: From: Michael Niedermayer This should increase coverage Signed-off-by: Michael Niedermayer Signed-off-by: James Almer Ping for set. --- tools/target_dec_fuzzer.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tools/target_dec_fuzze

[FFmpeg-devel] [PATCH v3] avdevice/decklink_dec: map the raw_format instead of hardcode

2020-11-19 Thread lance . lmwang
From: Limin Wang The patch will change the numerical values for the string constants so bump micro version. Signed-off-by: Limin Wang --- libavdevice/decklink_common.h | 9 + libavdevice/decklink_dec.cpp | 3 ++- libavdevice/decklink_dec_c.c | 14 +++--- libavdevice/version

Re: [FFmpeg-devel] [PATCH v2] fate/hevc-conformance: add clip for persistent_rice_adaptation_enabled_flag

2020-11-19 Thread Guangxin Xu
Hi folks, Could you help upload the bits file in https://www.itu.int/wftp3/av-arch/jctvc-site/bitstream_exchange/draft_conformance/RExt/WPP_HIGH_TP_444_8BIT_RExt_Apple_2.zip ? it's required by https://patchwork.ffmpeg.org/project/ffmpeg/patch/20201115023622.17605-1-oddst...@gmail.com and https://pa

Re: [FFmpeg-devel] [PATCH v2 0/7] HEVC native support for Screen content coding

2020-11-19 Thread Linjie Fu
On Thu, Nov 19, 2020 at 5:50 AM Michael Niedermayer wrote: > On Thu, Oct 29, 2020 at 02:57:13PM +0100, Christophe Gisquet wrote: > > Hi, > > > > Le mar. 29 sept. 2020 à 17:55, Linjie Fu a > écrit : > > > I didn’t see such plans for now, hence adding sufficient error message > > > seems to be a p

Re: [FFmpeg-devel] [RFC][PATCH 18/18] avcodec/avpacket: make the AVPacketList API thread safe

2020-11-19 Thread Michael Niedermayer
On Wed, Nov 18, 2020 at 01:52:47PM -0300, James Almer wrote: > Signed-off-by: James Almer > --- > I don't know if this is necessary, so i'm sending it as an RFC. > > libavcodec/avpacket.c| 34 +++--- > libavcodec/packet_internal.h | 2 ++ > 2 files changed, 3

Re: [FFmpeg-devel] [PATCH] avcodec/cuviddec: fix CUDA_ERROR_INVALID_CONTEXT error found by cuda-memcheck tool

2020-11-19 Thread Timo Rothenpieler
On 18.11.2020 09:24, leozhang wrote: Test command like below: cuda-memcheck ./ffmpeg -hwaccel cuvid -c:v h264_cuvid -i input_file -c:v h264_nvenc -f null - Signed-off-by: leozhang --- libavcodec/cuviddec.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/libavcodec/cuvid

Re: [FFmpeg-devel] [RFC][PATCH 18/18] avcodec/avpacket: make the AVPacketList API thread safe

2020-11-19 Thread James Almer
On 11/19/2020 1:18 PM, Michael Niedermayer wrote: On Wed, Nov 18, 2020 at 01:52:47PM -0300, James Almer wrote: Signed-off-by: James Almer --- I don't know if this is necessary, so i'm sending it as an RFC. libavcodec/avpacket.c| 34 +++--- libavcodec/pack

Re: [FFmpeg-devel] [PATCH 14/18] avformat/flacenc: port to the new packet list API

2020-11-19 Thread Michael Niedermayer
On Wed, Nov 18, 2020 at 01:52:43PM -0300, James Almer wrote: > Signed-off-by: James Almer > --- > libavformat/flacenc.c | 13 - > 1 file changed, 8 insertions(+), 5 deletions(-) crashes -i ~/bug/857/rythmortis.flac -t 5 -bitexact -y 24bit.flac not sure where the sample is, i couldnt

Re: [FFmpeg-devel] [PATCH 14/18] avformat/flacenc: port to the new packet list API

2020-11-19 Thread James Almer
On 11/19/2020 1:42 PM, Michael Niedermayer wrote: On Wed, Nov 18, 2020 at 01:52:43PM -0300, James Almer wrote: Signed-off-by: James Almer --- libavformat/flacenc.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) crashes -i ~/bug/857/rythmortis.flac -t 5 -bitexact -y 24b

[FFmpeg-devel] [PATCH 14/18 v2] avformat/flacenc: port to the new packet list API

2020-11-19 Thread James Almer
Signed-off-by: James Almer --- libavformat/flacenc.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/libavformat/flacenc.c b/libavformat/flacenc.c index a24d3be85d..3459c815db 100644 --- a/libavformat/flacenc.c +++ b/libavformat/flacenc.c @@ -39,7 +39,7 @@ typede

[FFmpeg-devel] Is there a way to turn off debug info

2020-11-19 Thread Budi
did compile all libavcodec source and found its size to be 193 MB Is there a way to turn off debug info option in compiling it Would anyone please help me point out where the makefile code line is to do that ? ___ ffmpeg-devel mailing list ffmpeg-devel@f

Re: [FFmpeg-devel] Is there a way to turn off debug info

2020-11-19 Thread Andreas Rheinhardt
Budi: > did compile all libavcodec source and found its size to be 193 MB > > Is there a way to turn off debug info option in compiling it > Would anyone please help me point out where the makefile code line is > to do that ? Use --disable-debug when running configure. Also: Wrong list. - Andrea

Re: [FFmpeg-devel] Next developer meeting

2020-11-19 Thread Thilo Borgmann
Am 19.11.20 um 06:01 schrieb Steven Liu: > > >> 2020年11月19日 下午12:05,Zane van Iperen 写道: >> >> >> >> On 19/11/20 1:46 pm, Steven Liu wrote: 2020年11月18日 下午8:59,Thilo Borgmann 写道: Hi, > we haven't had a meeting for quite some time and are beyond schedule > anyway. So I

Re: [FFmpeg-devel] [PATCH v3] avdevice/decklink_dec: map the raw_format instead of hardcode

2020-11-19 Thread Marton Balint
On Thu, 19 Nov 2020, lance.lmw...@gmail.com wrote: From: Limin Wang The patch will change the numerical values for the string constants so bump micro version. Signed-off-by: Limin Wang --- libavdevice/decklink_common.h | 9 + libavdevice/decklink_dec.cpp | 3 ++- libavdevice/deckl

[FFmpeg-devel] [PATCH 1/6] avutil/timecode: allow drop frame timecodes for multiples of 30000/1001 fps

2020-11-19 Thread Marton Balint
Signed-off-by: Marton Balint --- libavutil/timecode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavutil/timecode.c b/libavutil/timecode.c index f2db21c52c..8fcdf320ee 100644 --- a/libavutil/timecode.c +++ b/libavutil/timecode.c @@ -196,8 +196,8 @@ static int chec

[FFmpeg-devel] [PATCH 2/6] avutil/timecode: add av_timecode_init_from_components

2020-11-19 Thread Marton Balint
Signed-off-by: Marton Balint --- doc/APIchanges | 3 +++ libavutil/timecode.c | 28 ++-- libavutil/timecode.h | 17 + libavutil/version.h | 2 +- 4 files changed, 39 insertions(+), 11 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index

[FFmpeg-devel] [PATCH 3/6] avdevice/decklink_dec: add support for 50/60 fps timecode

2020-11-19 Thread Marton Balint
Signed-off-by: Marton Balint --- doc/indevs.texi | 5 +++ libavdevice/decklink_dec.cpp | 64 +--- 2 files changed, 57 insertions(+), 12 deletions(-) diff --git a/doc/indevs.texi b/doc/indevs.texi index 62b6ebb3e3..3924d03908 100644 --- a/doc/indevs.t

[FFmpeg-devel] [PATCH 4/6] avdevice/decklink_enc: simplify usage of buffercount type

2020-11-19 Thread Marton Balint
Also remove some leftover declaration of CreateDeckLinkIteratorInstance(). Signed-off-by: Marton Balint --- libavdevice/decklink_common.h | 7 --- libavdevice/decklink_enc.cpp | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/libavdevice/decklink_common.h b/libavdevic

[FFmpeg-devel] [PATCH 5/6] avdevice/decklink: warn about too old decklink API version

2020-11-19 Thread Marton Balint
Signed-off-by: Marton Balint --- libavdevice/decklink_common.cpp | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp index 8b58ede1ef..24aa9b1d13 100644 --- a/libavdevice/decklink_common.cpp

[FFmpeg-devel] [PATCH 6/6] fftools/cmdutils: also print warnings when using -sinks and -sources

2020-11-19 Thread Marton Balint
Signed-off-by: Marton Balint --- fftools/cmdutils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c index 88fdbeaf1e..4eb68d2201 100644 --- a/fftools/cmdutils.c +++ b/fftools/cmdutils.c @@ -2308,7 +2308,7 @@ int show_sources(void *op

Re: [FFmpeg-devel] [PATCH] avformat/mpegts: make sure mpegts_read_header always stops at the first pmt

2020-11-19 Thread Ross Nicholson
On Wed, 18 Nov 2020 at 20:11, Marton Balint wrote: > > > On Sun, 15 Nov 2020, Ross Nicholson wrote: > > > On Sat, 14 Nov 2020 at 23:40, Marton Balint wrote: > > > >> mpegts_read_header stops parsing the file at the first PMT. However the > >> check > >> that ensured this was wrong because stream

Re: [FFmpeg-devel] [PATCH] http: Check for AVERROR_EOF in the check for premature end

2020-11-19 Thread Jan Ekström
On Fri, Nov 13, 2020 at 12:17 AM Martin Storsjö wrote: > > When the check was added (in 3668701f9600, in 2015), some IO > functions returned 0 on EOF (in particular, the TCP protocol > did, but the TLS protocol returned AVERROR_EOF). Since > 0e1f771d2200d in 2017, the TCP protocol also returns AVE

Re: [FFmpeg-devel] [PATCH v3] avdevice/decklink_dec: map the raw_format instead of hardcode

2020-11-19 Thread lance . lmwang
On Thu, Nov 19, 2020 at 09:39:14PM +0100, Marton Balint wrote: > > > On Thu, 19 Nov 2020, lance.lmw...@gmail.com wrote: > > > From: Limin Wang > > > > The patch will change the numerical values for the string constants so bump > > micro version. > > > > Signed-off-by: Limin Wang > > --- > >

[FFmpeg-devel] [PATCH v4] avdevice/decklink_dec: map the raw_format instead of hardcode

2020-11-19 Thread lance . lmwang
From: Limin Wang The patch will change the numerical values for the string constants so bump micro version. Signed-off-by: Limin Wang --- libavdevice/decklink_common.h | 9 + libavdevice/decklink_dec.cpp | 3 ++- libavdevice/decklink_dec_c.c | 14 +++--- libavdevice/version

Re: [FFmpeg-devel] [PATCH] http: Return AVERROR_EOF instead of 0 in some EOF conditions

2020-11-19 Thread Jan Ekström
On Fri, Nov 13, 2020 at 12:32 AM Martin Storsjö wrote: > > IO functions are expected to return AVERROR_EOF instead of 0 > nowadays. This is also expected by other higher level layers > within the http protocol itself (e.g. the reconnect mechanism). > --- > libavformat/http.c | 4 ++-- > 1 file ch

Re: [FFmpeg-devel] [PATCH] avcodec/cuviddec: fix CUDA_ERROR_INVALID_CONTEXT error found by cuda-memcheck tool

2020-11-19 Thread leozhang
Timo Rothenpieler 于2020年11月20日周五 上午12:29写道: > > On 18.11.2020 09:24, leozhang wrote: > > Test command like below: > > cuda-memcheck ./ffmpeg -hwaccel cuvid -c:v h264_cuvid -i input_file -c:v > > h264_nvenc -f null - > > > > Signed-off-by: leozhang > > --- > > libavcodec/cuviddec.c | 15 +++

Re: [FFmpeg-devel] [PATCH v3 1/6] avformat/rtspdec: add network init to listen mode

2020-11-19 Thread Andriy Gelman
On Mon, 12. Oct 16:36, Andriy Gelman wrote: > From: Andriy Gelman > > As per the docs network initialization is required before ff_url_join(). > Furthermore, because the ff_network_init() was skipped, this makes > one additional call to ff_network_close() if the stream exits without > errors. >

[FFmpeg-devel] [PATCH v2] avcodec/cuviddec: fix CUDA_ERROR_INVALID_CONTEXT error found by cuda-memcheck tool

2020-11-19 Thread leozhang
Test command like below: cuda-memcheck ./ffmpeg -hwaccel cuvid -c:v h264_cuvid -i input_file -c:v h264_nvenc -f null - Signed-off-by: leozhang --- libavcodec/cuviddec.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c index 5e698d4cd0..61d

[FFmpeg-devel] [PATCH] Support HDR10+ metadata for HEVC.

2020-11-19 Thread Mohammad Izadi
From: Mohammad Izadi HDR10+ is dynamic metadata (A/341 Amendment - SMPTE2094-40) that needs to be decoded from ITU-T T.35 in HEVC bitstream. The HDR10+ is transferred to side data packet to be used or passed through. --- The fate test file can be found here: https://drive.google.com/file/d/1vc

[FFmpeg-devel] [PATCH v2 003/162] avcodec/tscc2: Combine tables for initializing VLCs

2020-11-19 Thread Andreas Rheinhardt
Using one big table for the symbols and lengths makes it possible to remove the pointers to the individual tables. Signed-off-by: Andreas Rheinhardt --- libavcodec/tscc2.c | 8 ++- libavcodec/tscc2data.h | 116 ++--- 2 files changed, 34 insertions(+), 90

[FFmpeg-devel] [PATCH v2 004/162] avcodec/bitstream: Allow static VLC tables to be bigger than needed

2020-11-19 Thread Andreas Rheinhardt
Right now the allocated size of the VLC table of a static VLC has to exactly match the size actually used for the VLC: If it is not enough, abort is called; if it is more than enough, an error message is emitted. This is no problem when one wants to initialize an individual VLC via one of the INIT_

[FFmpeg-devel] [PATCH v2 002/162] avcodec/tscc2: Reduce the size of the tables used to initialize VLCs

2020-11-19 Thread Andreas Rheinhardt
After permuting both the codes, lengths and symbols tables so that the codes tables are ordered from left to right in the tree, the codes tables can be easily computed from the lengths tables at runtime and therefore omitted. This saves about 2KB from the binary. Signed-off-by: Andreas Rheinhardt

[FFmpeg-devel] [PATCH v2 005/162] avcodec/tscc2: Mark tscc2 decoder as init-threadsafe

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/tscc2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/tscc2.c b/libavcodec/tscc2.c index 10bdff9a4e..17eb2c854f 100644 --- a/libavcodec/tscc2.c +++ b/libavcodec/tscc2.c @@ -374,5 +374,5 @@ AVCodec ff_tscc2_decoder =

[FFmpeg-devel] [PATCH v2 007/162] avcodec/cllc: Improve creating VLCs

2020-11-19 Thread Andreas Rheinhardt
One can offload the computation of the codes to ff_init_vlc_from_lengths(); this also improves performance: The number of decicycles for one call to read_code_table() decreased from 198343 to 148338 with the sample sample-cllc-rgb.avi from the FATE suite; it has been looped 100 times and the test r

[FFmpeg-devel] [PATCH v2 008/162] avcodec/smacker: Improve creating Huffman VLC tables

2020-11-19 Thread Andreas Rheinhardt
The Smacker Huffman tables are already stored in a tree-like structure; in particular, they are naturally ordered from left to right in the tree and are therefore suitable to be initialized by ff_init_vlc_from_lengths() which avoids traversing the data twice in order to sort only the codes that are

[FFmpeg-devel] [PATCH v2 011/162] avcodec/on2avcdata: Combine tables for codebooks

2020-11-19 Thread Andreas Rheinhardt
Using one big table for the codebook symbols and lengths makes it possible to remove the pointers to the individual tables. Signed-off-by: Andreas Rheinhardt --- libavcodec/on2avc.c | 8 ++- libavcodec/on2avcdata.c | 132 ++-- libavcodec/on2avcdata.h |

[FFmpeg-devel] [PATCH v2 009/162] avcodec/smacker: Mark decoders as init-threadsafe

2020-11-19 Thread Andreas Rheinhardt
Both Smacker audio and video decoders don't use/modify any global state. Signed-off-by: Andreas Rheinhardt --- libavcodec/smacker.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index 871a76257a..8db33c9275 100644 --- a/libavcod

[FFmpeg-devel] [PATCH v2 014/162] avcodec/imc: Avoid offsets table when creating VLCs

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/imc.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/libavcodec/imc.c b/libavcodec/imc.c index 5a1649ab62..deb88d4d5d 100644 --- a/libavcodec/imc.c +++ b/libavcodec/imc.c @@ -113,11 +113,6 @@ static VLC huffman_v

[FFmpeg-devel] [PATCH v2 016/162] avcodec/clearvideo: Avoid code duplication when initializing VLCs

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/clearvideo.c | 201 +++- libavcodec/clearvideodata.h | 104 ++- 2 files changed, 89 insertions(+), 216 deletions(-) diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c index ef09b137c4

[FFmpeg-devel] [PATCH v2 017/162] avcodec/clearvideo: Avoid huge VLC length tables

2020-11-19 Thread Andreas Rheinhardt
After the motion vector and bias values tables have been reordered so that the codes are ordered from left to right, it emerged that the length of these entries are actually ascending for every table. Therefore it is possible to encode them in a run-length style and create the actual length tables

[FFmpeg-devel] [PATCH v2 018/162] avcodec/clearvideo: Improve handling of VLC escape values

2020-11-19 Thread Andreas Rheinhardt
Both the motion vector as well as the bias VLCs have an escape code; for the motion vectors, this value depended on the specific VLC table, whereas all the bias VLCs used the same value; the escape value has not been inlined in the latter case. But for both kinds of VLCs there are lots of values t

[FFmpeg-devel] [PATCH v2 019/162] avcodec/clearvideo: Inline constants

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/clearvideo.c | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c index 3e666b98e9..0885b82837 100644 --- a/libavcodec/clearvideo.c +++ b/libavcodec/clearvideo.

[FFmpeg-devel] [PATCH v2 020/162] avcodec/clearvideo: Use minimal max_depth in get_vlc2()

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/clearvideo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c index 0885b82837..a5f9cc3ca2 100644 --- a/libavcodec/clearvideo.c +++ b/libavcodec/clearvideo.c @@ -369,7 +369,7 @@ s

[FFmpeg-devel] [PATCH v2 021/162] avcodec/clearvideo: Apply VLC offset during init

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/clearvideo.c | 7 +++-- libavcodec/clearvideodata.h | 54 ++--- 2 files changed, 23 insertions(+), 38 deletions(-) diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c index a5f9cc3ca2..ff6445b1de 100

[FFmpeg-devel] [PATCH v2 022/162] avcodec/clearvideo: Make VLC tables static

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/clearvideo.c | 117 +++- 1 file changed, 55 insertions(+), 62 deletions(-) diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c index ff6445b1de..7342557cd2 100644 --- a/libavcodec/clearvideo.c +++ b/l

[FFmpeg-devel] [PATCH v2 023/162] avcodec/wnv1: Make array for initializing VLC smaller

2020-11-19 Thread Andreas Rheinhardt
This is possible by switching to ff_init_vlc_from_lengths() which allows to replace the table for the codes (which need an uint16_t) by a table of symbols which fit into an uint8_t. Also switch to an ordinary INIT_VLC macro while just at it. Signed-off-by: Andreas Rheinhardt --- libavcodec/wnv1.

[FFmpeg-devel] [PATCH v2 024/162] avcodec/wnv1: Apply offset during init, not later every time

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/wnv1.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c index f8a9b94746..7dd0e72596 100644 --- a/libavcodec/wnv1.c +++ b/libavcodec/wnv1.c @@ -43,10 +43,10 @@ static inline int wnv1_ge

[FFmpeg-devel] [PATCH v2 025/162] avcodec/wnv1: Make decoder init-threadsafe

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/wnv1.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c index 7dd0e72596..a17a2bc3b6 100644 --- a/libavcodec/wnv1.c +++ b/libavcodec/wnv1.c @@ -24,6 +24,8 @@ * Winnov WNV

[FFmpeg-devel] [PATCH v2 027/162] avcodec/cook: Apply offset when initializing VLC table

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/cook.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/cook.c b/libavcodec/cook.c index f22fd02209..7756098d97 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -200,7 +200,7 @@ static av_cold int init_coo

[FFmpeg-devel] [PATCH v2 026/162] avcodec/cook: Make tables to initialize VLCs smaller

2020-11-19 Thread Andreas Rheinhardt
Up until now, the Cook decoder used tables for the lengths of codes and tables of the codes itself to initialize VLCs; the tables for the codes were of type uint16_t because the codes were so long. It did not use explicit symbol tables. This commit instead reorders the tables so that the code table

[FFmpeg-devel] [PATCH v2 028/162] avcodec/cook: Avoid big length tables for VLC initialization

2020-11-19 Thread Andreas Rheinhardt
Permuting the tables used to initialize the Cook VLCs so that the code tables are ordered from left to right in the tree revealed that the length of the codes are ascending from left to right. Therefore one can run-length encode them to avoid the big length tables; this saves a bit more than 1KB.

[FFmpeg-devel] [PATCH v2 029/162] avcodec/cook: Inline constants

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/cook.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libavcodec/cook.c b/libavcodec/cook.c index 4d06488c10..1968f2f896 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -65,6 +65,9 @@ #define SUBBAND_SIZE

[FFmpeg-devel] [PATCH v2 030/162] avcodec/rv10: Make initializing static RV10 VLCs thread-safe

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/rv10.c | 27 +++ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index e594160fea..3a487a6b3e 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -28,6 +28,7 @@ #i

[FFmpeg-devel] [PATCH v2 031/162] avcodec/rv10: Reduce the size of the tables used to initialize VLCs

2020-11-19 Thread Andreas Rheinhardt
This can be achieved by switching to ff_init_vlc_from_lengths() which allows to replace two uint16_t tables for codes with uint8_t tables for the symbols by permuting the tables so that the codes are ordered from left to right in the tree in which case they can be easily computed from the lengths a

[FFmpeg-devel] [PATCH v2 032/162] avcodec/rv10: Reduce number of exceptions when reading VLC value

2020-11-19 Thread Andreas Rheinhardt
RealVideo 1.0 uses an insane way to encode DC coefficients: There are several symbols that (for no good reason whatsoever) have multiple encodings, leading to longer codes than necessary. More specifically, the tree for the 256 luma symbols contains 255 codes belonging to 255 different symbols on

[FFmpeg-devel] [PATCH v2 033/162] avcodec/rv10: Use symbol table more effectively

2020-11-19 Thread Andreas Rheinhardt
The RealVideo 1.0 decoder uses VLCs to parse DC coefficients. But the values returned from get_vlc2() are not directly used; instead -(val - 128) (which is in the range -127..128) is. This transformation is unnecessary as it can effectively be done when initializing the VLC by modifying the symbols

[FFmpeg-devel] [PATCH v2 034/162] avcodec/rv10: Make VLC tables smaller

2020-11-19 Thread Andreas Rheinhardt
These tables were huge (14 bits) because one needed 14 bits in order to find out whether a code is valid and in the VLC table or a valid code that required hacky workarounds due to RealVideo 1.0 using multiple codes for the same symbol and the code predating the introduction of symbols tables for V

[FFmpeg-devel] [PATCH v2 035/162] avcodec/rv10: Simplify handling of skip VLC entries

2020-11-19 Thread Andreas Rheinhardt
The VLC tables to be used for parsing RealVideo 1.0 DC coefficients are weird: The luma table contains a block of 2^11 codes beginning with the same prefix and length that all have the same symbol (i.e. value only depends upon the prefix); the same goes for the chroma block (except it's only 2^9 co

[FFmpeg-devel] [PATCH v2 036/162] avcodec/mimic: Reduce size of tables used to initialize VLCs

2020-11-19 Thread Andreas Rheinhardt
By switching to ff_init_vlc_from_lengths() one can replace a table of codes of type uint32_t with a table of symbols of type uint8_t saving space. The old tables also had holes in it (because of the symbols) which are now superfluous, saving ever more space. Signed-off-by: Andreas Rheinhardt ---

[FFmpeg-devel] [PATCH v2 037/162] avcodec/mimic: Cleanup generically upon init failure

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/mimic.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c index 7a74b99086..6ceb5c9ae3 100644 --- a/libavcodec/mimic.c +++ b/libavcodec/mimic.c @@ -138,10 +138,8 @@ static av_cold int

[FFmpeg-devel] [PATCH v2 038/162] avcodec/mimic: Mark decoder as init-threadsafe

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/mimic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c index 6ceb5c9ae3..60c612003a 100644 --- a/libavcodec/mimic.c +++ b/libavcodec/mimic.c @@ -441,5 +441,6 @@ AVCodec ff_mimic_decoder

[FFmpeg-devel] [PATCH v2 039/162] avcodec/mimic: Make VLC static

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/mimic.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c index 60c612003a..ea6a7efe93 100644 --- a/libavcodec/mimic.c +++ b/libavcodec/mimic.c @@ -23,6 +23,8 @@

[FFmpeg-devel] [PATCH v2 040/162] avcodec/motionpixels: Only create VLC iff it is going to be used

2020-11-19 Thread Andreas Rheinhardt
If the Huffman tree consists of only one entry (which has length zero), no tree is used at all for parsing as the VLC API currently can't handle this. So it makes no sense to create a VLC in this case. Commit 41b7389cade702383e59343561776f83bb26e17f added a check for whether creating the VLC shoul

[FFmpeg-devel] [PATCH v2 041/162] avcodec/motionpixels: Be more strict when parsing Huffman trees

2020-11-19 Thread Andreas Rheinhardt
This ensures that the number of leafs in the Huffman tree equals the number it is supposed to be and therefore ensures that the VLC tree is complete, allowing us to remove checks. Signed-off-by: Andreas Rheinhardt --- An alternative would be to use current_codes_count to initialize the VLC. lib

[FFmpeg-devel] [PATCH v2 042/162] avcodec/motionpixels: Don't check for complete VLC

2020-11-19 Thread Andreas Rheinhardt
The algorithm used here always creates a complete VLC, so it is unnecessary to check this again. Signed-off-by: Andreas Rheinhardt --- libavcodec/motionpixels.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index 4b9830fbed..a65250efe5

[FFmpeg-devel] [PATCH v2 047/162] avcodec/mpc7: Apply offsets when creating VLCs

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/mpc7.c | 14 +++--- libavcodec/mpc7data.h | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c index 28c066d055..ad0fc6dbbc 100644 --- a/libavcodec/mpc7.c +++ b/libavcodec/mpc7.

[FFmpeg-devel] [PATCH v2 043/162] avcodec/motionpixels: Use symbols table

2020-11-19 Thread Andreas Rheinhardt
If allows us to directly store the deltas in the VLC table and therefore avoids a level of indirection. Signed-off-by: Andreas Rheinhardt --- libavcodec/motionpixels.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/libavcodec/motionpixels.c b/libavcodec/mo

[FFmpeg-devel] [PATCH v2 048/162] avcodec/mpc7: Avoid offsets table when creating VLCs

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/mpc7.c | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c index ad0fc6dbbc..0b9e6f0088 100644 --- a/libavcodec/mpc7.c +++ b/libavcodec/mpc7.c @@ -38,22 +38,15 @@ static

[FFmpeg-devel] [PATCH v2 044/162] avcodec/motionpixels: Simplify creating VLC tables

2020-11-19 Thread Andreas Rheinhardt
By using ff_init_vlc_from_lengths(), we do not have to keep track of the codes themselves, but can offload this to ff_init_vlc_from_lengths(). Furthermore, the old code presumed sizeof(int) == 4; this is no longer so. Signed-off-by: Andreas Rheinhardt --- libavcodec/motionpixels.c | 19

[FFmpeg-devel] [PATCH v2 045/162] avcodec/motionpixels: Make decoder init-threadsafe

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/motionpixels.c | 12 ++-- libavcodec/motionpixels_tablegen.h | 3 +-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index 22deb9d1bd..b08a2f624b 100644 --- a/

[FFmpeg-devel] [PATCH v2 050/162] avcodec/mpc8: Apply offsets when initializing VLCs

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/mpc8.c | 21 + 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c index 920180e92d..b5f89c845b 100644 --- a/libavcodec/mpc8.c +++ b/libavcodec/mpc8.c @@ -39,9 +39,6 @@ static VL

[FFmpeg-devel] [PATCH v2 049/162] avcodec/mpc8: Reduce size of tables used to initialize VLCs

2020-11-19 Thread Andreas Rheinhardt
By switching to ff_init_vlc_from_lengths() one can make a table of codes of type uint8_t superfluous, saving space. Other VLCs (those without dedicated symbols table and with codes of type uint8_t) have been made to use ff_init_vlc_from_lengths(), too, because it reduces codesize (ff_init_vlc_from

[FFmpeg-devel] [PATCH v2 046/162] avcodec/mpc7: Reduce size of tables used to initialize VLCs

2020-11-19 Thread Andreas Rheinhardt
By switching to ff_init_vlc_from_lengths() one can replace tables of codes of type uint16_t with tables of symbols of type uint8_t, saving space. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpc7.c | 27 libavcodec/mpc7data.h | 156 -- 2

[FFmpeg-devel] [PATCH v2 051/162] avcodec/mpc8: Reduce the size of the length tables to initialize VLCs

2020-11-19 Thread Andreas Rheinhardt
After permuting both length, code as well as symbol tables so that the codes are ordered from left to right in the tree, it became apparent that the length of the codes decreases from left to right. Therefore one can run-length encode the lengths to save space. This commit implements this. Signed-

[FFmpeg-devel] [PATCH v2 052/162] avcodec/mpc8: Reduce the size of some VLCs

2020-11-19 Thread Andreas Rheinhardt
Several of the quantisation VLCs come in pairs and up until now the number of bits used for each VLC was set to the same value for both VLCs in such a pair even when one of the two required only a lower number. This is a waste given that the get_vlc2() call is compatible with these two VLCs using a

[FFmpeg-devel] [PATCH v2 053/162] avcodec/mpc8: Avoid code duplication when initializing VLCs

2020-11-19 Thread Andreas Rheinhardt
Up until now, VLCs that were part of an array of VLCs were often not initialized in a loop, but separately. The probable reason for this was that these VLCs differed slightly in the parameters to be used for them (i.e. the number of codes or the number of bits to be used differs), so that one would

[FFmpeg-devel] [PATCH v2 054/162] avcodec/mpegaudiodsp: Combine initializing float and int tables

2020-11-19 Thread Andreas Rheinhardt
This avoids code duplication in the functions used to initialize them and allows to remove an AVOnce. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegaudiodsp.c | 54 +++--- libavcodec/mpegaudiodsp.h | 3 -- libavcodec/mpegaudiodsp_template.c | 42

[FFmpeg-devel] [PATCH v2 055/162] avcodec/fft_template, fft_init_table: Make ff_fft_init() thread-safe

2020-11-19 Thread Andreas Rheinhardt
Commit 1af615683e4a1a858407afbaa2fd686842da7e49 put initializing the ff_fft_offsets_lut (which is typically used if FFT_FIXED_32) behind an ff_thread_once() to make ff_fft_init() thread-safe; yet there is a second place where said table may be initialized which is not guarded by this AVOnce: ff_fft

[FFmpeg-devel] [PATCH v2 056/162] avcodec/imc: Make imc/iac decoders init-threadsafe

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/imc.c | 35 ++- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/libavcodec/imc.c b/libavcodec/imc.c index deb88d4d5d..c26d8b0149 100644 --- a/libavcodec/imc.c +++ b/libavcodec/imc.c @@ -38,6 +38,7 @@

[FFmpeg-devel] [PATCH v2 057/162] avcodec/mpegaudiodsp: Make ff_mpadsp_init() thread-safe

2020-11-19 Thread Andreas Rheinhardt
The only thing missing for this is to make ff_mpadsp_init_x86() thread-safe; it currently isn't because a static table is initialized every time ff_mpadsp_init() is called (when ARCH_X86 is true). Solve this by initializing this table only once, namely together with the ordinary not-arch specific t

[FFmpeg-devel] [PATCH v2 058/162] avcodec/mpegaudiodsp: Make initializing synth windows thread-safe

2020-11-19 Thread Andreas Rheinhardt
These arrays are used by the Musepack decoders, the MPEG audio decoders as well as qdm2 and up until now, these arrays might be initialized more than once, leading to potential data races as well as unnecessary initializations. Therefore this commit ensures that each array will only be initialized

[FFmpeg-devel] [PATCH v2 059/162] avcodec/mpc7: Make decoder init-threadsafe

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/mpc7.c | 65 +-- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c index b067d77c4b..720d67623f 100644 --- a/libavcodec/mpc7.c +++ b/libavcodec/mpc7.c @

[FFmpeg-devel] [PATCH v2 060/162] avcodec/mpc8: Make decoder init-threadsafe

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/mpc8.c | 62 +-- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c index c263762c8b..6939716176 100644 --- a/libavcodec/mpc8.c +++ b/libavcodec/mpc8.c @

[FFmpeg-devel] [PATCH v2 061/162] avcodec/mobiclip: Avoid redundant codes table to initialize VLCs

2020-11-19 Thread Andreas Rheinhardt
If both codes, lengths and symbols tables are ordered so that the codes are sorted from left to right in the tree, the codes can be easily derived from the lengths and therefore become redundant. This is exploited in this commit to remove the codes tables for the mobiclip decoder; notice that table

[FFmpeg-devel] [PATCH v2 062/162] avcodec/mobiclip: Avoid code duplication when initializing VLCs

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/mobiclip.c | 107 -- 1 file changed, 51 insertions(+), 56 deletions(-) diff --git a/libavcodec/mobiclip.c b/libavcodec/mobiclip.c index db9266f72a..d188e1cd57 100644 --- a/libavcodec/mobiclip.c +++ b/libavco

[FFmpeg-devel] [PATCH v2 063/162] avcodec/mobiclip: Make decoder init-threadsafe

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/mobiclip.c | 47 +-- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/libavcodec/mobiclip.c b/libavcodec/mobiclip.c index d188e1cd57..ce9bcf6afb 100644 --- a/libavcodec/mobiclip.c +++ b/libavco

[FFmpeg-devel] [PATCH v2 064/162] avcodec/mobiclip: Reindentation

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/mobiclip.c | 128 +- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/libavcodec/mobiclip.c b/libavcodec/mobiclip.c index ce9bcf6afb..1969ae3318 100644 --- a/libavcodec/mobiclip.c +++ b/libavco

[FFmpeg-devel] [PATCH v2 065/162] avcodec/qdm2: Make tables used to initialize VLCs smaller

2020-11-19 Thread Andreas Rheinhardt
After permuting the codes, symbols and lengths tables used to initialize the VLCs so that the codes are ordered from left to right in the Huffman tree, the codes become redundant as they can be easily computed from the lengths at runtime (or at compile time with --enable-hardcoded-tables); in this

[FFmpeg-devel] [PATCH v2 066/162] avcodec/qdm2: Apply offsets when initializing VLCs

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/qdm2.c | 2 +- libavcodec/qdm2_tablegen.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index bd365739ce..f2e78c3fa2 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -

[FFmpeg-devel] [PATCH v2 067/162] avcodec/qdm2: Initialize array of VLCs in a loop

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/qdm2_tablegen.h | 12 +++- libavcodec/qdm2data.h | 28 ++-- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/libavcodec/qdm2_tablegen.h b/libavcodec/qdm2_tablegen.h index e948e92295..2ae8449c14 1

[FFmpeg-devel] [PATCH v2 068/162] avcodec/qdm2: Avoid offsets table when initializing VLCs

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/qdm2_tablegen.h | 42 ++ 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/libavcodec/qdm2_tablegen.h b/libavcodec/qdm2_tablegen.h index 2ae8449c14..ca47fea2dc 100644 --- a/libavcodec/qdm2_tablegen.

[FFmpeg-devel] [PATCH v2 069/162] avcodec/qdm2: Make decoder init-threadsafe

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/qdm2.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index f2e78c3fa2..b1465750c2 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -36,6 +36,7 @@ #include #inc

[FFmpeg-devel] [PATCH v2 070/162] avcodec/qdm2: Remove outdated comment

2020-11-19 Thread Andreas Rheinhardt
Forgotten in f054e309c58894450a5d18cce9799ef58aab9f14. Signed-off-by: Andreas Rheinhardt --- libavcodec/qdm2.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index b1465750c2..fbc4c0cfdd 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -1595,8

[FFmpeg-devel] [PATCH v2 071/162] avcodec/rv40vlc2: Make VLC smaller

2020-11-19 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/rv40vlc2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/rv40vlc2.h b/libavcodec/rv40vlc2.h index 15119a145b..4cdc7a4193 100644 --- a/libavcodec/rv40vlc2.h +++ b/libavcodec/rv40vlc2.h @@ -33,7 +33,7 @@ * codes use

  1   2   >