Re: [FFmpeg-devel] [PATCH 1/5] avcodec/rl2: Remove wrong check

2022-10-01 Thread Andreas Rheinhardt
Andreas Rheinhardt: > This check is intended to be avoid buffer overflows, > yet there are four problems with it: > 1. It has an in-built off-by-one error: len == out_end - out > is perfectly fine and nothing to worry about. > This off-by-one error led to the pixel in the lower-right corner > not b

[FFmpeg-devel] [PATCH 14/14] avcodec/huffyuv: Speed up generating Huffman codes

2022-10-01 Thread Andreas Rheinhardt
The codes here have the property that the long codes are to the left of the tree (each zero bit child node is by definition to the left of its one bit sibling); they also have the property that among codes of the same length, the symbol is ascending from left to right. These properties can be used

[FFmpeg-devel] [PATCH 13/14] avcodec/huffyuv: Split HYuvContext into decoder and encoder context

2022-10-01 Thread Andreas Rheinhardt
While the share of elements used by both is quite big, the amount of code shared between the decoders and encoders is negligible. Therefore one can easily split the context if one wants to. The reasons for doing so are that the non-shared elements are non-negligible: The stats array which is only u

[FFmpeg-devel] [PATCH 12/14] avcodec/huffyuv: Inline ff_huffyuv_common_init() in its callers

2022-10-01 Thread Andreas Rheinhardt
This is in preparation for splitting HYuvContext. Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuv.c| 9 - libavcodec/huffyuv.h| 1 - libavcodec/huffyuvdec.c | 5 +++-- libavcodec/huffyuvenc.c | 4 +++- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/libav

[FFmpeg-devel] [PATCH 11/14] avcodec/huffyuv: Use AVCodecContext.(width|height) directly

2022-10-01 Thread Andreas Rheinhardt
These parameters are easily accessible whereever they are accessed, so using copies from HYuvContext is unnecessary. Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuv.c| 9 ++--- libavcodec/huffyuv.h| 3 +-- libavcodec/huffyuvdec.c | 10 +- libavcodec/huffyuvenc.c |

[FFmpeg-devel] [PATCH 10/14] avcodec/huffyuvenc: Avoid unnecessary function call

2022-10-01 Thread Andreas Rheinhardt
av_pix_fmt_get_chroma_sub_sample() is superfluous if one already has an AVPixFmtDescriptor. Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuvenc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index f903b1924a..9

[FFmpeg-devel] [PATCH 09/14] avcodec/huffyuvenc: Improve code locality

2022-10-01 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuvenc.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index 020159a20e..f903b1924a 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -207,7 +20

[FFmpeg-devel] [PATCH 08/14] avocdec/huffyuvdec: Don't use HYuvContext.avctx

2022-10-01 Thread Andreas Rheinhardt
It is nearly unused anyway, so stop use the field altogether. This is in preparation for splitting HYuvContext into decoder and encoder contexts. Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuv.c| 1 - libavcodec/huffyuvdec.c | 18 +- libavcodec/huffyuvenc.c | 1 +

[FFmpeg-devel] [PATCH 07/14] avcodec/huffyuvencdsp: Pass pix_fmt directly when initing dsp

2022-10-01 Thread Andreas Rheinhardt
It is the only thing that is actually used. Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuvenc.c | 2 +- libavcodec/huffyuvencdsp.c | 4 ++-- libavcodec/huffyuvencdsp.h | 6 +++--- libavcodec/x86/huffyuvencdsp_init.c | 4 ++-- 4 files changed, 8 insertions(

[FFmpeg-devel] [PATCH 06/14] avcodec/huffyuvenc: Don't second-guess error code

2022-10-01 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuvenc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index 8867de0d44..84ab7f423a 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -391,9 +391,

[FFmpeg-devel] [PATCH 05/14] avcodec/huffyuvenc: Remove redundant call

2022-10-01 Thread Andreas Rheinhardt
All codecs here have the FF_CODEC_CAP_INIT_CLEANUP set, so ff_huffyuv_common_end() will be called automatically in encode_end() on error. Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuvenc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuve

[FFmpeg-devel] [PATCH 04/14] avcodec/huffyuvenc: Remove always-false check

2022-10-01 Thread Andreas Rheinhardt
The ffvhuff encoder has AVCodec.pix_fmts set and therefore encode_preinit_video() checks that the used pixel format is permissible. Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuvenc.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuve

[FFmpeg-devel] [PATCH 03/14] avcodec/huffyuvenc: Avoid pointless indirections

2022-10-01 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuvenc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index d159d5d309..fa4923962f 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -348,7 +348,

[FFmpeg-devel] [PATCH 02/14] avcodec/huffyuvenc: Remove redundant casts

2022-10-01 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuvenc.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index 2d63b12abc..d159d5d309 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@

[FFmpeg-devel] [PATCH 01/14] avcodec/ylc: Remove inclusion of huffyuvdsp.h

2022-10-01 Thread Andreas Rheinhardt
Also improve the other headers a bit. Signed-off-by: Andreas Rheinhardt --- libavcodec/ylc.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libavcodec/ylc.c b/libavcodec/ylc.c index 3ea6749ffe..29c10f05da 100644 --- a/libavcodec/ylc.c +++ b/libavcodec/ylc.c @@ -18,21 +1

[FFmpeg-devel] [PATCH v2] avcodec/tiff: add read support for compressed rgb floating point formats

2022-10-01 Thread mindmark
From: Mark Reid floating point uses a slightly different predictor technique describe here http://chriscox.org/TIFFTN3d1.pdf Here is a link the test files, if someone could add them to fate me https://www.dropbox.com/s/fg59h2os4gb4wug/tiff_fate_samples.zip --- libavcodec/tiff.c

Re: [FFmpeg-devel] [PATCH] avcodec/tiff: add support for decoding compressed rgb floating point formats

2022-10-01 Thread Andreas Rheinhardt
Mark Reid: > On Sat, Oct 1, 2022 at 7:22 AM Andreas Rheinhardt < > andreas.rheinha...@outlook.com> wrote: > >> mindm...@gmail.com: >>> From: Mark Reid >>> >>> floating point uses a slightly different predictor technique describe >> here >>> http://chriscox.org/TIFFTN3d1.pdf >>> >>> Here is a link

Re: [FFmpeg-devel] [PATCH] avcodec/tiff: add support for decoding compressed rgb floating point formats

2022-10-01 Thread Mark Reid
On Sat, Oct 1, 2022 at 7:22 AM Andreas Rheinhardt < andreas.rheinha...@outlook.com> wrote: > mindm...@gmail.com: > > From: Mark Reid > > > > floating point uses a slightly different predictor technique describe > here > > http://chriscox.org/TIFFTN3d1.pdf > > > > Here is a link the test files, if

[FFmpeg-devel] [PATCH] avcodec/mpeg4audio: Move ff_copy_pce_data() to a header of its own

2022-10-01 Thread Andreas Rheinhardt
It is only used by three of the thirty files that (potentially indirectly) include mpeg4audio.h. Twenty of these files won't have a put_bits.h inclusion any more after this patch. Signed-off-by: Andreas Rheinhardt --- libavcodec/aac_adtstoasc_bsf.c | 1 + libavcodec/mpeg4audio.c | 1

[FFmpeg-devel] [PATCH] avcodec/sbcdec: Remove always-false check

2022-10-01 Thread Andreas Rheinhardt
We never guard against a user freeing/stealing the private context; and returning AVERROR(EIO) is inappropriate. Signed-off-by: Andreas Rheinhardt --- libavcodec/sbcdec.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/libavcodec/sbcdec.c b/libavcodec/sbcdec.c index 3fac2f5016..fd7c2e5e80

[FFmpeg-devel] [PATCH] avcodec/asv: Split ASV1Context into decoder and encoder contexts

2022-10-01 Thread Andreas Rheinhardt
A lot of the stuff in ASV1Context is actually only used by decoders or encoders, but not both: Of the seven contexts in ASV1Context, only the BswapDSPContext is used by both. So splitting makes sense. Signed-off-by: Andreas Rheinhardt --- libavcodec/asv.c| 4 ++- libavcodec/asv.h| 25 ++

Re: [FFmpeg-devel] [PATCH] avcodec/tiff: add support for decoding compressed rgb floating point formats

2022-10-01 Thread Andreas Rheinhardt
mindm...@gmail.com: > From: Mark Reid > > floating point uses a slightly different predictor technique describe here > http://chriscox.org/TIFFTN3d1.pdf > > Here is a link the test files, if someone could add them to fate me > https://www.dropbox.com/s/fg59h2os4gb4wug/tiff_fate_samples.zip > >

[FFmpeg-devel] [PATCH] avcodec/tiff: add support for decoding compressed rgb floating point formats

2022-10-01 Thread mindmark
From: Mark Reid floating point uses a slightly different predictor technique describe here http://chriscox.org/TIFFTN3d1.pdf Here is a link the test files, if someone could add them to fate me https://www.dropbox.com/s/fg59h2os4gb4wug/tiff_fate_samples.zip --- libavcodec/tiff.c

[FFmpeg-devel] [PATCH 3/3] lavc/opusdsp: RISC-V V (256-bit vectors) postfilter

2022-10-01 Thread remi
From: Rémi Denis-Courmont This adds a variant of the postfilter for use with 256-bit vectors (or larger). Since the function requires 160-bit logical vectors, we can cut the group multiplier down to just one. The different vector type is passed via register. Unfortunately, there is no VSETIVL in

[FFmpeg-devel] [PATCH 1/3] lavc/opusdsp: RISC-V V postfilter

2022-10-01 Thread remi
From: Rémi Denis-Courmont This is optimised for a vector size of 128-bit. Or maybe it would be more accurate to state that this is not properly optimised for larger vector sizes, as they would work just fine with a smaller vector group multiplier. --- libavcodec/opusdsp.c| 2 ++ lib

[FFmpeg-devel] [PATCH 2/3] lavu/riscv: helper macro for VTYPE encoding

2022-10-01 Thread remi
From: Rémi Denis-Courmont On most cases, the vector type (VTYPE) for the RISC-V Vector extension is supplied as an immediate value, with either of the VSETVLI or VSETIVLI instructions. There is however a third instruction VSETVL which takes the vector type from a general purpose register. That is

[FFmpeg-devel] [PATCH 0/3] RISC-V V Opus post-filter

2022-10-01 Thread Rémi Denis-Courmont
Hello, This adds the Opus post-filter. Opus deemphasis is not included as it (IMHO) involves too many unknowns to write a good implementation without benchmarking. This post-filter implementation merely vectors the scalar product. It does purposed not vector the memory accesses to avoid r

Re: [FFmpeg-devel] [crop support for matroska demuxer 1/3] libavcodec: Add crop related fields to structure AVCodecContext and AVCodecParameters.

2022-10-01 Thread Timo Rothenpieler
On 01.10.2022 08:13, OvchinnikovDmitrii wrote: --- libavcodec/avcodec.h | 8 libavcodec/codec_par.h | 8 2 files changed, 16 insertions(+) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 7365eb5cc0..66df571afc 100644 --- a/libavcodec/avcodec.h +++ b/libavco

Re: [FFmpeg-devel] [crop support for matroska demuxer 2/3] libavcodec: Public code to support container crop

2022-10-01 Thread Hendrik Leppkes
On Sat, Oct 1, 2022 at 8:14 AM OvchinnikovDmitrii wrote: > > Support both simple and receive_frame api > The container crop information is applied additional to frame crop information > --- > libavcodec/codec_par.c | 8 > libavcodec/decode.c| 20 > 2 files chang

Re: [FFmpeg-devel] [crop support for matroska demuxer 1/3] libavcodec: Add crop related fields to structure AVCodecContext and AVCodecParameters.

2022-10-01 Thread Hendrik Leppkes
On Sat, Oct 1, 2022 at 8:14 AM OvchinnikovDmitrii wrote: > > --- > libavcodec/avcodec.h | 8 > libavcodec/codec_par.h | 8 > 2 files changed, 16 insertions(+) > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h > index 7365eb5cc0..66df571afc 100644 > --- a/libavcodec/