Re: [FFmpeg-devel] [PATCH 5/5] avcodec/proresenc_anatoliy: do not write into chroma reserved bitfields

2024-01-10 Thread Clément Bœsch
On Wed, Jan 10, 2024 at 10:43:59PM +0100, Stefano Sabatini wrote: > > 0x82 is actually writting into the reserved bits. > > nit: writting typo [...] > LGTM, thanks. Fixed the typo and applied the patchset. Thank you -- Clément B. ___ ffmpeg-devel mai

Re: [FFmpeg-devel] [PATCH 5/5] avcodec/proresenc_anatoliy: do not write into chroma reserved bitfields

2024-01-10 Thread Clément Bœsch
Ping on this last patch. -- Clément B. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] Initial tickering at unifying ProRes encoder

2024-01-10 Thread Clément Bœsch
On Sun, Dec 24, 2023 at 11:56:56AM +0100, Stefano Sabatini wrote: > On date Monday 2023-12-11 02:35:01 +0100, Clément Bœsch wrote: > > Hello there, > > > > I'm currently investigating an issue¹ affecting Kostya ProRes encoder > > which is not reproducible with Anat

Re: [FFmpeg-devel] [PATCH 4/5] avcodec/proresenc_anatoliy: do not write into alpha reserved bitfields

2024-01-08 Thread Clément Bœsch
On Mon, Jan 08, 2024 at 09:23:05PM +0100, Stefano Sabatini wrote: > On date Sunday 2024-01-07 19:16:46 +0100, Clément Bœsch wrote: > > This byte represents 4 reserved bits followed by 4 alpha_channel_type bits. > > > > alpha_channel_type currently has 3 differents defined va

Re: [FFmpeg-devel] [PATCH 3/5] avcodec/proresenc_kostya: do not write into alpha reserved bitfields

2024-01-08 Thread Clément Bœsch
On Mon, Jan 08, 2024 at 09:10:09PM +0100, Stefano Sabatini wrote: > On date Sunday 2024-01-07 19:16:45 +0100, Clément Bœsch wrote: > > This byte represents 4 reserved bits followed by 4 alpha_channel_type bits. > > > > alpha_channel_type currently has 3 differents defined va

Re: [FFmpeg-devel] [PATCH 04/35] avcodec/proresenc_anatoliy: move run/lev to codebook LUT to shared proresdata

2024-01-08 Thread Clément Bœsch
On Tue, Dec 12, 2023 at 09:02:23AM +0100, Stefano Sabatini wrote: > On date Monday 2023-12-11 02:35:05 +0100, Clément Bœsch wrote: > > This is going to be shared with proresenc_kostya in the upcoming commit. > > --- > > libavcodec/proresdata.c | 6 ++ > &g

Re: [FFmpeg-devel] [PATCH 27/35] avcodec/proresenc_anatoliy: remove TO_GOLOMB2()

2024-01-07 Thread Clément Bœsch
On Sun, Dec 24, 2023 at 12:43:32AM +0100, Stefano Sabatini wrote: > On date Monday 2023-12-11 02:35:28 +0100, Clément Bœsch wrote: > > A few cosmetics aside, this makes the function identical to the one with > > the same name in proresenc_kostya. > > --- > > libavcod

Re: [FFmpeg-devel] [PATCH 3/5] avcodec/proresenc_kostya: do not write into alpha reserved bitfields

2024-01-07 Thread Clément Bœsch
On Wed, Dec 13, 2023 at 12:16:56AM +0100, Michael Niedermayer wrote: > On Wed, Dec 13, 2023 at 12:13:36AM +0100, Michael Niedermayer wrote: > > On Mon, Dec 11, 2023 at 08:06:53PM +0100, Clément Bœsch wrote: > > > This byte represents 4 reserved bits followed by 4 alpha_channe

[FFmpeg-devel] [PATCH 5/5] avcodec/proresenc_anatoliy: do not write into chroma reserved bitfields

2024-01-07 Thread Clément Bœsch
The layout for the frame flags is as follow: chroma_format u(2) reserved u(2) interlace_mode u(2) reserved u(2) chroma_format has 2 allowed values: 0: reserved 1: reserved 2: 4:2:2 3: 4:4:4 interlace_mode has 3 allowed values: 0: progressive 1: tff 2

[FFmpeg-devel] [PATCH 4/5] avcodec/proresenc_anatoliy: do not write into alpha reserved bitfields

2024-01-07 Thread Clément Bœsch
This byte represents 4 reserved bits followed by 4 alpha_channel_type bits. alpha_channel_type currently has 3 differents defined values: 0 (no alpha), 1 (8b alpha), and 2 (16b alpha), all the other values are reserved. The 4 initial reserved bits are expected to be 0. --- libavcodec/proresenc_an

[FFmpeg-devel] [PATCH 3/5] avcodec/proresenc_kostya: do not write into alpha reserved bitfields

2024-01-07 Thread Clément Bœsch
This byte represents 4 reserved bits followed by 4 alpha_channel_type bits. alpha_channel_type currently has 3 differents defined values: 0 (no alpha), 1 (8b alpha), and 2 (16b alpha), all the other values are reserved. This part is correctly written (alpha_bits>>3 does the correct thing), but the

[FFmpeg-devel] [PATCH 2/5] avcodec/proresenc_kostya: use a compatible bitstream version

2024-01-07 Thread Clément Bœsch
Quoting SMPTE RDD 36:2015: A decoder shall abort if it encounters a bitstream with an unsupported bitstream_version value. If 0, the value of the chroma_format syntax element shall be 2 (4:2:2 sampling) and the value of the alpha_channel_type element shall be 0 (no encoded alpha); if 1, any

[FFmpeg-devel] [PATCH 1/5] avcodec/proresenc_anatoliy: use a compatible bitstream version

2024-01-07 Thread Clément Bœsch
Quoting SMPTE RDD 36:2015: A decoder shall abort if it encounters a bitstream with an unsupported bitstream_version value. If 0, the value of the chroma_format syntax element shall be 2 (4:2:2 sampling) and the value of the alpha_channel_type element shall be 0 (no encoded alpha); if 1, any

Re: [FFmpeg-devel] [PATCH 09/35] avcodec/proresenc_kostya: fix chroma quantisation matrix in frame header

2024-01-06 Thread Clément Bœsch
On Sat, Dec 16, 2023 at 06:12:19PM +0100, Stefano Sabatini wrote: > On date Monday 2023-12-11 02:35:10 +0100, Clément Bœsch wrote: > > --- > > libavcodec/proresenc_kostya.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/libavcode

Re: [FFmpeg-devel] [PATCH 2/2] avcodec/proresenc: fix alpha plane encoding bitstream

2023-12-29 Thread Clément Bœsch
On Wed, Dec 27, 2023 at 01:29:58PM +0100, Stefano Sabatini wrote: [...] > LGTM, thanks. Thank you for the review. I will add to the commit description that this change was made possible because of paid work for the jitter company (https://jitter.video). If there is no objection, I will push this s

[FFmpeg-devel] [PATCH 2/2] avcodec/proresenc: fix alpha plane encoding bitstream

2023-12-26 Thread Clément Bœsch
These functions encode a slice of alpha (1 to 8 macroblocks) which are expected to be encoded as a repeated sequence of "[diff][run-1]", where diff is the running difference of the alpha value and run is how many times that value is expected to be duplicated (within the limit of a grand total of 20

[FFmpeg-devel] [PATCH 1/2] avcodec/proresenc: make transparency honored in mov/QT

2023-12-26 Thread Clément Bœsch
In the mov muxer (in mov_write_video_tag()), bits_per_coded_sample will be written under certain conditions and is required to be 32 for the transparency to be honored in QuickTime. prores_kostya already has this setting but prores_anatoliy and prores_videotoolbox didn't. --- libavcodec/proresenc

[FFmpeg-devel] [PATCH 5/5] avcodec/proresenc_anatoliy: do not write into chroma reserved bitfields

2023-12-11 Thread Clément Bœsch
The layout for the frame flags is as follow: chroma_format u(2) reserved u(2) interlace_mode u(2) reserved u(2) chroma_format has 2 allowed values: 0: reserved 1: reserved 2: 4:2:2 3: 4:4:4 interlace_mode has 3 allowed values: 0: progressive 1: tff 2

[FFmpeg-devel] [PATCH 4/5] avcodec/proresenc_anatoliy: do not write into alpha reserved bitfields

2023-12-11 Thread Clément Bœsch
This byte represents 4 reserved bits followed by 4 alpha_channel_type bits. alpha_channel_type currently has 3 differents defined values: 0 (no alpha), 1 (8b alpha), and 2 (16b alpha), all the other values are reserved. The 4 initial reserved bits are expected to be 0. --- libavcodec/proresenc_an

[FFmpeg-devel] [PATCH 3/5] avcodec/proresenc_kostya: do not write into alpha reserved bitfields

2023-12-11 Thread Clément Bœsch
This byte represents 4 reserved bits followed by 4 alpha_channel_type bits. alpha_channel_type currently has 3 differents defined values: 0 (no alpha), 1 (8b alpha), and 2 (16b alpha), all the other values are reserved. This part is correctly written (alpha_bits>>3 does the correct thing), but the

[FFmpeg-devel] [PATCH 2/5] avcodec/proresenc_kostya: use a compatible bitstream version

2023-12-11 Thread Clément Bœsch
Quoting SMPTE RDD 36:2015: A decoder shall abort if it encounters a bitstream with an unsupported bitstream_version value. If 0, the value of the chroma_format syntax element shall be 2 (4:2:2 sampling) and the value of the alpha_channel_type element shall be 0 (no encoded alpha); if 1, any

[FFmpeg-devel] [PATCH 1/5] avcodec/proresenc_anatoliy: use a compatible bitstream version

2023-12-11 Thread Clément Bœsch
Quoting SMPTE RDD 36:2015: A decoder shall abort if it encounters a bitstream with an unsupported bitstream_version value. If 0, the value of the chroma_format syntax element shall be 2 (4:2:2 sampling) and the value of the alpha_channel_type element shall be 0 (no encoded alpha); if 1, any

[FFmpeg-devel] Misc ProRes frame header conformity fixes

2023-12-11 Thread Clément Bœsch
A bunch of fixes (currently made on top of the previous patchset but shouldn't conflict much with a rebase) which are not extensively tested. If some people have specific decoders available, tests are welcome. ___ ffmpeg-devel mailing list ffmpeg-devel

Re: [FFmpeg-devel] Initial tickering at unifying ProRes encoder

2023-12-11 Thread Clément Bœsch
On Mon, Dec 11, 2023 at 10:15:09AM +0100, Anton Khirnov wrote: > Quoting Clément Bœsch (2023-12-11 02:35:01) > > Hello there, > > > > I'm currently investigating an issue¹ affecting Kostya ProRes encoder > > which is not reproducible with Anatoliy encoder (but it&#

[FFmpeg-devel] [PATCH 07/35] avcodec/proresenc_anatoliy: move DC codebook LUT to shared proresdata

2023-12-10 Thread Clément Bœsch
This is going to be shared with proresenc_kostya in the upcoming commit. --- libavcodec/proresdata.c | 2 ++ libavcodec/proresdata.h | 1 + libavcodec/proresenc_anatoliy.c | 3 +-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/proresdata.c b/libavcodec/p

[FFmpeg-devel] [PATCH 35/35] avcodec/proresenc_kostya: make a few cosmetics in encode_acs()

2023-12-10 Thread Clément Bœsch
Unify cosmetics with encode_acs() from proresenc_anatoliy. --- libavcodec/proresenc_kostya.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c index c6c045be73..05e90bb236 100644 --- a/libavcodec/proresenc_kost

[FFmpeg-devel] [PATCH 33/35] avcodec/proresenc_anatoliy: execute AC run/level FFMIN() at assignment

2023-12-10 Thread Clément Bœsch
This matches the logic from the function of the same name in proresenc_kostya. --- libavcodec/proresenc_anatoliy.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 161a05a6e6..2515ee38f8 100644

[FFmpeg-devel] [PATCH 34/35] avcodec/proresenc_anatoliy: make a few cosmetics in encode_acs()

2023-12-10 Thread Clément Bœsch
This makes the function pretty much identical to the function of the same name in proresenc_kostya. --- libavcodec/proresenc_anatoliy.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c i

[FFmpeg-devel] [PATCH 32/35] avcodec/proresenc_anatoliy: rework inner loop in encode_acs()

2023-12-10 Thread Clément Bœsch
This matches the logic from the function of the same name in proresenc_kostya. --- libavcodec/proresenc_anatoliy.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 816c27e481..161a05a6e6 100644 -

[FFmpeg-devel] [PATCH 31/35] avcodec/proresenc_anatoliy: avoid using ff_ prefix in function arguments

2023-12-10 Thread Clément Bœsch
--- libavcodec/proresenc_anatoliy.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 57324a3b27..816c27e481 100644 --- a/libavcodec/proresenc_anatoliy.c +++ b/libavcodec/proresenc_anatoliy.c @@ -284,

[FFmpeg-devel] [PATCH 30/35] avcodec/proresenc_anatoliy: rework encode_ac_coeffs() prototype

2023-12-10 Thread Clément Bœsch
This makes the prototype closer to the function of the same name in proresenc_kostya. --- libavcodec/proresenc_anatoliy.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 88c6d47ab7..57324a3b27 1006

[FFmpeg-devel] [PATCH 29/35] avcodec/proresenc_anatoliy: replace get_level() with FFABS()

2023-12-10 Thread Clément Bœsch
This matches the code from proresenc_kostya. --- libavcodec/proresenc_anatoliy.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 0318379461..88c6d47ab7 100644 --- a/libavcodec/proresenc_anatoliy.c +

[FFmpeg-devel] [PATCH 28/35] avcodec/proresenc_anatoliy: cosmetics to make encode_dcs() identical to the one in Kostya encoder

2023-12-10 Thread Clément Bœsch
--- libavcodec/proresenc_anatoliy.c | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index aed5c68b1b..0318379461 100644 --- a/libavcodec/proresenc_anatoliy.c +++ b/libavcodec/proresenc_anatoli

[FFmpeg-devel] [PATCH 27/35] avcodec/proresenc_anatoliy: remove TO_GOLOMB2()

2023-12-10 Thread Clément Bœsch
A few cosmetics aside, this makes the function identical to the one with the same name in proresenc_kostya. --- libavcodec/proresenc_anatoliy.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index bdf7bfac

[FFmpeg-devel] [PATCH 26/35] avcodec/proresenc_anatoliy: only pass down the first scale to encode_dcs()

2023-12-10 Thread Clément Bœsch
This matches encode_dcs() prototype from proresenc_kostya. --- libavcodec/proresenc_anatoliy.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 56baeb9956..bdf7bface4 100644 --- a/libavcodec/proresen

[FFmpeg-devel] [PATCH 25/35] avcodec/proresenc_anatoliy: shuffle declarations around in encode_dcs()

2023-12-10 Thread Clément Bœsch
This makes the function closer to the same function in proresenc_kostya. --- libavcodec/proresenc_anatoliy.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 4b72798689..56baeb9956 100644 --- a/l

[FFmpeg-devel] [PATCH 24/35] avcodec/proresenc_anatoliy: rename TO_GOLOMB() to MAKE_CODE()

2023-12-10 Thread Clément Bœsch
This matches the name in proresenc_kostya. --- libavcodec/proresenc_anatoliy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 43dee7f79b..4b72798689 100644 --- a/libavcodec/proresenc_anatoliy.c +++ b/l

[FFmpeg-devel] [PATCH 22/35] avcodec/proresenc_anatoliy: remove IS_NEGATIVE() macro

2023-12-10 Thread Clément Bœsch
This makes the function closer to encode_acs() in proresenc_kostya. --- libavcodec/proresenc_anatoliy.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 4ea3d89126..43dee7f79b 100644 --- a/libavcodec/prore

[FFmpeg-devel] [PATCH 23/35] avcodec/proresenc_kostya: add Anatoliy copyright

2023-12-10 Thread Clément Bœsch
Both encoders share a lot of code from both authors. --- libavcodec/proresenc_kostya.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c index e0aa7cf47a..c6c045be73 100644 --- a/libavcodec/proresenc_kostya.c +++ b/libavcodec/proresen

[FFmpeg-devel] [PATCH 21/35] avcodec/proresenc_anatoliy: rename new_dc to dc

2023-12-10 Thread Clément Bœsch
This makes the function closer to encode_dcs() in proresenc_kostya. --- libavcodec/proresenc_anatoliy.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 0d8ca5515f..4ea3d89126 100644 --- a/libavcodec

[FFmpeg-devel] [PATCH 19/35] avcodec/proresenc_anatoliy: import GET_SIGN() macro from Kostya encoder and use it

2023-12-10 Thread Clément Bœsch
--- libavcodec/proresenc_anatoliy.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index a418a12705..0de262c9c5 100644 --- a/libavcodec/proresenc_anatoliy.c +++ b/libavcodec/proresenc_anatoliy.c @@ -255,9

[FFmpeg-devel] [PATCH 18/35] avcodec/proresenc_anatoliy: directly work with blocks in encode_dcs()

2023-12-10 Thread Clément Bœsch
This makes the function closer to encode_dcs() in proresenc_kostya. --- libavcodec/proresenc_anatoliy.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 97d681467d..a418a12705 100644 --- a/libavcode

[FFmpeg-devel] [PATCH 20/35] avcodec/proresenc_anatoliy: compute sign only once

2023-12-10 Thread Clément Bœsch
This makes the function closer to encode_dcs() in proresenc_kostya. --- libavcodec/proresenc_anatoliy.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 0de262c9c5..0d8ca5515f 100644 --- a/libavcodec

[FFmpeg-devel] [PATCH 17/35] avcodec/proresenc_anatoliy: reduce DC encoding function prototype differences with Kostya encoder

2023-12-10 Thread Clément Bœsch
--- libavcodec/proresenc_anatoliy.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index f8feff850f..97d681467d 100644 --- a/libavcodec/proresenc_anatoliy.c +++ b/libavcodec/proresenc_anatoliy.c @@ -2

[FFmpeg-devel] [PATCH 16/35] avcodec/proresenc_anatoliy: execute codebook FFMIN() at assignment

2023-12-10 Thread Clément Bœsch
This makes the function closer to encode_dcs() in proresenc_kostya. --- libavcodec/proresenc_anatoliy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index e79c465590..f8feff850f 100644 --- a/libavcodec/pro

[FFmpeg-devel] [PATCH 15/35] avcodec/proresenc_anatoliy: rename new_code/code to code/codebook

2023-12-10 Thread Clément Bœsch
This makes the function closer to encode_dcs() in proresenc_kostya. --- libavcodec/proresenc_anatoliy.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index b8433ee872..e79c465590 100644 --- a/l

[FFmpeg-devel] [PATCH 14/35] avcodec/proresenc_anatoliy: inline QSCALE()

2023-12-10 Thread Clément Bœsch
Also replaces 16384 with 0x4000. This makes the function slightly closer to same function in proresenc_kostya. --- libavcodec/proresenc_anatoliy.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 86e

[FFmpeg-devel] [PATCH 13/35] avcodec/proresenc_anatoliy: rework encode_codeword() prototype

2023-12-10 Thread Clément Bœsch
This matches the function of the same name in proresenc_kostya. --- libavcodec/proresenc_anatoliy.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index c7e43fc88c..86e436615c 100644 --- a/libavcodec/

[FFmpeg-devel] [PATCH 11/35] avcodec/proresenc_anatoliy: use FRAME_ID defined in proresdata.h

2023-12-10 Thread Clément Bœsch
--- libavcodec/proresenc_anatoliy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index d6f5cefc16..804ff6ddf7 100644 --- a/libavcodec/proresenc_anatoliy.c +++ b/libavcodec/proresenc_anatoliy.c @@ -755,7 +755,7

[FFmpeg-devel] [PATCH 12/35] avcodec/proresenc_anatoliy: shuffle encode_codeword() code to match Kostya encoder

2023-12-10 Thread Clément Bœsch
Code is functionally identical, it's just rename of variables, cosmetics and branch logic shuffling. --- libavcodec/proresenc_anatoliy.c | 45 + 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_an

[FFmpeg-devel] [PATCH 06/35] avcodec/proresenc_anatoliy: remove duplicated define

2023-12-10 Thread Clément Bœsch
This is already defined in proresdata.h --- libavcodec/proresenc_anatoliy.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 6b2e513bed..c6f49be9b8 100644 --- a/libavcodec/proresenc_anatoliy.c +++ b/libavcodec/proresenc_an

[FFmpeg-devel] [PATCH 10/35] avcodec/proresenc_kostya: simplify quantization matrix bytestream writing

2023-12-10 Thread Clément Bœsch
--- libavcodec/proresenc_kostya.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c index 103051830a..e0aa7cf47a 100644 --- a/libavcodec/proresenc_kostya.c +++ b/libavcodec/proresenc_kostya.c @@ -1014,12 +1014,

[FFmpeg-devel] [PATCH 09/35] avcodec/proresenc_kostya: fix chroma quantisation matrix in frame header

2023-12-10 Thread Clément Bœsch
--- libavcodec/proresenc_kostya.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c index 2d45f9a685..103051830a 100644 --- a/libavcodec/proresenc_kostya.c +++ b/libavcodec/proresenc_kostya.c @@ -1019,7 +1019,7 @@ stat

[FFmpeg-devel] [PATCH 08/35] avcodec/proresenc_kostya: save a few operations in DC encoding

2023-12-10 Thread Clément Bœsch
This matches the logic from proresenc_anatoliy. --- libavcodec/proresenc_kostya.c | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c index f883ab550b..2d45f9a685 100644 --- a/libavcodec/proresenc_

[FFmpeg-devel] [PATCH 05/35] avcodec/proresenc_kostya: remove one LUT indirection for run/level to codebook mapping

2023-12-10 Thread Clément Bœsch
This is following the same logic as proresenc_anatoliy. --- libavcodec/proresenc_kostya.c | 47 +++ 1 file changed, 14 insertions(+), 33 deletions(-) diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c index 6e1d5a0cef..f883ab550b 100644 ---

[FFmpeg-devel] [PATCH 04/35] avcodec/proresenc_anatoliy: move run/lev to codebook LUT to shared proresdata

2023-12-10 Thread Clément Bœsch
This is going to be shared with proresenc_kostya in the upcoming commit. --- libavcodec/proresdata.c | 6 ++ libavcodec/proresdata.h | 2 ++ libavcodec/proresenc_anatoliy.c | 9 ++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/libavcodec/proresdata.c b/

[FFmpeg-devel] [PATCH 03/35] avcodec/proresenc_kostya: remove redundant codebook assignments

2023-12-10 Thread Clément Bœsch
This is already assigned at declaration. --- libavcodec/proresenc_kostya.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c index 7aed3974c3..6e1d5a0cef 100644 --- a/libavcodec/proresenc_kostya.c +++ b/libavcodec/proresenc_kostya.c

[FFmpeg-devel] [PATCH 02/35] avcodec/proresenc_kostya: remove unused plane factor variables

2023-12-10 Thread Clément Bœsch
--- libavcodec/proresenc_kostya.c | 36 --- 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c index 58fc340879..7aed3974c3 100644 --- a/libavcodec/proresenc_kostya.c +++ b/libavcodec/prorese

[FFmpeg-devel] [PATCH 01/35] avcodec/proresenc_kostya: remove an unnecessary parenthesis level in MAKE_CODE() macro

2023-12-10 Thread Clément Bœsch
--- libavcodec/proresenc_kostya.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c index 52fe5639b1..58fc340879 100644 --- a/libavcodec/proresenc_kostya.c +++ b/libavcodec/proresenc_kostya.c @@ -429,7 +429,7 @@ static

[FFmpeg-devel] Initial tickering at unifying ProRes encoder

2023-12-10 Thread Clément Bœsch
Hello there, I'm currently investigating an issue¹ affecting Kostya ProRes encoder which is not reproducible with Anatoliy encoder (but it's too early to say if the bug is not present there as well given the differences in quantization, and it's also unclear if the issue is even actually there in

Re: [FFmpeg-devel] 3 more dithering mode in paletteuse

2023-01-03 Thread Clément Bœsch
On Fri, Dec 30, 2022 at 12:34:51PM +0100, Clément Bœsch wrote: [...] Patchset applied -- Clément B. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email

Re: [FFmpeg-devel] New iteration for the color quantization in palette{gen, use}

2023-01-03 Thread Clément Bœsch
On Wed, Dec 28, 2022 at 12:17:42AM +0100, Clément Bœsch wrote: [...] Patchset applied -- Clément B. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email

Re: [FFmpeg-devel] Rework color quantization in palette{gen,use}

2023-01-02 Thread Clément Bœsch
On Mon, Jan 02, 2023 at 10:57:33PM +0100, Michael Niedermayer wrote: [...] > > So I did a lot of experiments, and the explanation for the desaturated > > output at low number of colors can be found at the end of this article: > > http://blog.pkh.me/p/39-improving-color-quantization-heuristics.html

Re: [FFmpeg-devel] Rework color quantization in palette{gen,use}

2022-12-31 Thread Clément Bœsch
On Sun, Nov 06, 2022 at 06:30:22PM +0100, Michael Niedermayer wrote: > On Sun, Nov 06, 2022 at 06:09:41PM +0100, Michael Niedermayer wrote: > > On Sat, Nov 05, 2022 at 04:26:02PM +0100, Clément Bœsch wrote: > > > Hi, > > > > > > This patchset essentially fixes

Re: [FFmpeg-devel] 3 more dithering mode in paletteuse

2022-12-30 Thread Clément Bœsch
On Fri, Dec 30, 2022 at 12:34:51PM +0100, Clément Bœsch wrote: [...] > Here are some demonstrations of all the dithering with 2bpp: > https://imgur.com/a/2a1p4R8 Sorry, this is obviously 1bpp -- Clément B. ___ ffmpeg-devel mailing list ffmpeg

[FFmpeg-devel] [PATCH 4/4] avfilter/paletteuse: use explicit key indexes in set_frame_lut

2022-12-30 Thread Clément Bœsch
--- libavfilter/vf_paletteuse.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c index 252ad746f0..944ff5c74d 100644 --- a/libavfilter/vf_paletteuse.c +++ b/libavfilter/vf_paletteuse.c @@ -918,15 +918,1

[FFmpeg-devel] [PATCH 3/4] avfilter/paletteuse: add atkinson dithering

2022-12-30 Thread Clément Bœsch
Atkinson according to https://bisqwit.iki.fi/jutut/kuvat/ordered_dither/error_diffusion.txt: * 1 1/ 8 1 1 1 1 --- doc/filters.texi| 2 ++ libavfilter/vf_paletteuse.c | 23 +++ 2 files changed, 25 insertions(+) diff --git a/doc/filt

[FFmpeg-devel] [PATCH 2/4] avfilter/paletteuse: add burkes dithering

2022-12-30 Thread Clément Bœsch
Burkes according to https://bisqwit.iki.fi/jutut/kuvat/ordered_dither/error_diffusion.txt: * 8 4 2 4 8 4 2 / 32 --- doc/filters.texi| 2 ++ libavfilter/vf_paletteuse.c | 24 2 files changed, 26 insertions(+) diff --git a/doc/filters.tex

[FFmpeg-devel] [PATCH 1/4] avfilter/paletteuse: add sierra3 dithering

2022-12-30 Thread Clément Bœsch
Sierra3 according to https://bisqwit.iki.fi/jutut/kuvat/ordered_dither/error_diffusion.txt: * 5 3 2 4 5 4 2 2 3 2 / 32 --- doc/filters.texi| 2 ++ libavfilter/vf_paletteuse.c | 30 ++ 2 files changed, 32 insertions(+) dif

[FFmpeg-devel] 3 more dithering mode in paletteuse

2022-12-30 Thread Clément Bœsch
Hi, This patchset is to be applied on top of the previous one. Here are some demonstrations of all the dithering with 2bpp: https://imgur.com/a/2a1p4R8 Source images: 1. https://unsplash.com/photos/P4epudldYMU 2. https://unsplash.com/photos/iDNvparRZ2Q Note: both got resized to fit within a 102

Re: [FFmpeg-devel] [PATCH v2 01/32] avfilter/palettegen: allow a minimum of 2 colors

2022-12-28 Thread Clément Bœsch
On Wed, Dec 28, 2022 at 10:04:26PM +0100, Tomas Härdin wrote: [...] > Does this mean all-black with transparent is disallowed? Yes a single color with or without an extra transparency slot makes no sense. > Shouldn't it be max_colors + reserve < 2? max_colors accounts for the transparent color a

Re: [FFmpeg-devel] Rework color quantization in palette{gen,use}

2022-12-27 Thread Clément Bœsch
On Tue, Nov 08, 2022 at 10:37:59PM +, Soft Works wrote: [...] > For completeness, I'm also including the recent comparison, but it > seems you're already on track in this regard. If you remove the alpha from the input image you'll see that it performs pretty much as good. You can check with t

Re: [FFmpeg-devel] [PATCH 12/15] avfilter/palettegen: base split decision on a perceptual model

2022-12-27 Thread Clément Bœsch
On Sat, Nov 05, 2022 at 08:07:42PM +0100, Andreas Rheinhardt wrote: [...] > You are adding floating point to places where there was no floating > point before (some other patches of this patchset do the same). Is this > still bitexact across all supported arches? It should be good with the last it

[FFmpeg-devel] [PATCH v2 08/32] avfilter/paletteuse: remove redundant alpha condition

2022-12-27 Thread Clément Bœsch
This is redundant with a != 0xff below. --- libavfilter/vf_paletteuse.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c index 8954a02524..0861a70a0b 100644 --- a/libavfilter/vf_paletteuse.c +++ b/libavfilter/vf_pal

[FFmpeg-devel] [PATCH v2 32/32] avfilter/palette{gen, use}: misc for-loop cosmetics

2022-12-27 Thread Clément Bœsch
--- libavfilter/vf_palettegen.c | 19 +-- libavfilter/vf_paletteuse.c | 22 +- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/libavfilter/vf_palettegen.c b/libavfilter/vf_palettegen.c index 97e12f7274..4b69d3c63b 100644 --- a/libavfilter/vf_pal

[FFmpeg-devel] [PATCH v2 31/32] avfilter/paletteuse: move r, g, b computation in a more local scope

2022-12-27 Thread Clément Bœsch
--- libavfilter/vf_paletteuse.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c index 33b8e70293..e3462b4abb 100644 --- a/libavfilter/vf_paletteuse.c +++ b/libavfilter/vf_paletteuse.c @@ -262,9 +262,6 @@ static av_

[FFmpeg-devel] [PATCH v2 07/32] avfilter/paletteuse: remove unused alpha split dimension

2022-12-27 Thread Clément Bœsch
The equalities in the w{r,g,b} range checks make sure longest is never 0. Even if the alpha ended up being selected in get_next_color() it would cause underread memory accesses in its caller (colormap_insert). --- libavfilter/vf_paletteuse.c | 33 - 1 file changed,

[FFmpeg-devel] [PATCH v2 30/32] avfilter/paletteuse: remove mean error tool

2022-12-27 Thread Clément Bœsch
This belongs in another filter. --- libavfilter/vf_paletteuse.c | 31 --- 1 file changed, 31 deletions(-) diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c index 690422a842..33b8e70293 100644 --- a/libavfilter/vf_paletteuse.c +++ b/libavfilter/vf_p

[FFmpeg-devel] [PATCH v2 06/32] avfilter/paletteuse: name target color arg consistently in colormap functions

2022-12-27 Thread Clément Bœsch
--- libavfilter/vf_paletteuse.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c index fb4016b11c..f43f077454 100644 --- a/libavfilter/vf_paletteuse.c +++ b/libavfilter/vf_paletteuse.c @@ -180,7 +180,7 @@ static a

[FFmpeg-devel] [PATCH v2 29/32] avfilter/paletteuse: remove alternative search methods

2022-12-27 Thread Clément Bœsch
This is a maintenance pain more than anything. It appears to make the code slightly faster as a side effect. --- libavfilter/vf_paletteuse.c | 220 +--- 1 file changed, 31 insertions(+), 189 deletions(-) diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_pal

[FFmpeg-devel] [PATCH v2 28/32] avfilter/paletteuse: switch to recursive method

2022-12-27 Thread Clément Bœsch
It appears faster than the iterative method on my machine (1.06x faster), so I'm guessing compilers improved over time (the iterative version was slightly faster in the past). --- libavfilter/vf_paletteuse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_palette

[FFmpeg-devel] [PATCH v2 27/32] avfilter/paletteuse: use lowbias32 for color hashing

2022-12-27 Thread Clément Bœsch
Impact is more negligible than previous commit but still faster (1.02x). --- libavfilter/vf_paletteuse.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c index c32b73ab9a..c2d6333662 100644 --- a/libavfilter/vf_pa

[FFmpeg-devel] [PATCH v2 26/32] avfilter/palettegen: use lowbias32 for color hashing

2022-12-27 Thread Clément Bœsch
1.12x faster overall in palettegen on my machine. --- libavfilter/vf_palettegen.c | 19 ++- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/libavfilter/vf_palettegen.c b/libavfilter/vf_palettegen.c index 6301cf6358..97e12f7274 100644 --- a/libavfilter/vf_palettegen.c

[FFmpeg-devel] [PATCH v2 25/32] avfilter/palette: add lowbias32 hashing

2022-12-27 Thread Clément Bœsch
--- libavfilter/palette.c | 10 ++ libavfilter/palette.h | 5 + 2 files changed, 15 insertions(+) diff --git a/libavfilter/palette.c b/libavfilter/palette.c index 03e48fc71e..e21ab6ff4d 100644 --- a/libavfilter/palette.c +++ b/libavfilter/palette.c @@ -208,3 +208,13 @@ uint32_t ff_ok

[FFmpeg-devel] [PATCH v2 24/32] avfilter/palette{gen, use}: update Copyright after recent changes

2022-12-27 Thread Clément Bœsch
@@ /* * Copyright (c) 2015 Stupeflix + * Copyright (c) 2022 Clément Bœsch * * This file is part of FFmpeg. * diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c index 3af121b1eb..c32b73ab9a 100644 --- a/libavfilter/vf_paletteuse.c +++ b/libavfilter/vf_paletteuse.c @@ -1,5

[FFmpeg-devel] [PATCH v2 23/32] avfilter/palettegen: use libc qsort

2022-12-27 Thread Clément Bœsch
Now that the sort function is deterministic, we can rely on the libc sorting function. --- libavfilter/vf_palettegen.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavfilter/vf_palettegen.c b/libavfilter/vf_palettegen.c index 784e81b875..507690fa82 100644 --- a/libavfilt

[FFmpeg-devel] [PATCH v2 22/32] avfilter/palettegen: make refs order deterministic

2022-12-27 Thread Clément Bœsch
Currently, in case of equality on the first color channel, the order of the ref colors is defined by the hashing function. This commit makes the sorting deterministic and improve the hierarchical ordering. --- libavfilter/vf_palettegen.c| 61 ++ tests/ref/fate/f

[FFmpeg-devel] [PATCH v2 21/32] avfilter/palettegen: add a warning about supporting only sRGB

2022-12-27 Thread Clément Bœsch
--- libavfilter/vf_palettegen.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_palettegen.c b/libavfilter/vf_palettegen.c index 3178c43ab9..ba81739d27 100644 --- a/libavfilter/vf_palettegen.c +++ b/libavfilter/vf_palettegen.c @@ -451,9 +451,13 @@ static

[FFmpeg-devel] [PATCH v2 20/32] avfilter/palettegen: base box split decision on a perceptual model

2022-12-27 Thread Clément Bœsch
Similar to the change in paletteuse, we rely on a perceptual model to decide how and where to split the box. --- libavfilter/Makefile | 2 +- libavfilter/vf_palettegen.c| 48 -- tests/ref/fate/filter-palettegen-1 | 2 +- tests/ref/fate/filter-pal

[FFmpeg-devel] [PATCH v2 19/32] avfilter/palettegen: switch to signed arithmetic

2022-12-27 Thread Clément Bœsch
This prevents mixed sign arithmetic (typically because we have signed color channel differences), which has nasty side effects in C. --- libavfilter/vf_palettegen.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavfilter/vf_palettegen.c b/libavfilter/vf_palettegen.c

[FFmpeg-devel] [PATCH v2 18/32] avfilter/palettegen: rename local variable box_weight to weight

2022-12-27 Thread Clément Bœsch
This variable is used only for the running weight (used to reach the target median). The places where we actually need the box weight are changed to use box->weight. --- libavfilter/vf_palettegen.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/libavfilter/vf_

[FFmpeg-devel] [PATCH v2 17/32] avfilter/palettegen: misc cosmetics

2022-12-27 Thread Clément Bœsch
--- libavfilter/vf_palettegen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_palettegen.c b/libavfilter/vf_palettegen.c index 36f0a976d9..ad21882df3 100644 --- a/libavfilter/vf_palettegen.c +++ b/libavfilter/vf_palettegen.c @@ -132,7 +132,7 @@ static int c

[FFmpeg-devel] [PATCH v2 16/32] avfilter/palettegen: compute average color within compute_box_stats()

2022-12-27 Thread Clément Bœsch
--- libavfilter/vf_palettegen.c | 30 +- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/libavfilter/vf_palettegen.c b/libavfilter/vf_palettegen.c index 00b5f88c49..36f0a976d9 100644 --- a/libavfilter/vf_palettegen.c +++ b/libavfilter/vf_palettegen.c @@ -1

[FFmpeg-devel] [PATCH v2 15/32] avfilter/palettegen: change cut score from ∑e² to max e²

2022-12-27 Thread Clément Bœsch
This is following the results from personal research¹. ¹: https://github.com/ubitux/research/tree/main/color-quantization#results --- libavfilter/vf_palettegen.c| 3 ++- tests/ref/fate/filter-palettegen-1 | 2 +- tests/ref/fate/filter-palettegen-2 | 2 +- 3 files changed, 4 insertions(+),

[FFmpeg-devel] [PATCH v2 14/32] avfilter/palettegen: rename variance to cut_score

2022-12-27 Thread Clément Bœsch
"Variance" wasn't exactly the correct word; "cut score" is more agnostic, which will be useful when changing the algorithm in the next commit. --- libavfilter/vf_palettegen.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libavfilter/vf_palettegen.c b/libavfilter/

[FFmpeg-devel] [PATCH v2 13/32] avfilter/palettegen: always compute the box variance

2022-12-27 Thread Clément Bœsch
The variance computation is simple enough now (since we can use the axis squared errors) that it doesn't need to have a complex lazy computation logic. --- libavfilter/vf_palettegen.c | 42 - 1 file changed, 9 insertions(+), 33 deletions(-) diff --git a/libavfi

[FFmpeg-devel] [PATCH v2 12/32] avfilter/palettegen: use box->major_axis without intermediate variable

2022-12-27 Thread Clément Bœsch
--- libavfilter/vf_palettegen.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libavfilter/vf_palettegen.c b/libavfilter/vf_palettegen.c index ed1448755c..aa0c8fdc5b 100644 --- a/libavfilter/vf_palettegen.c +++ b/libavfilter/vf_palettegen.c @@ -363,22 +363,21 @@

[FFmpeg-devel] [PATCH v2 11/32] avfilter/palettegen: define the best axis to cut using the squared error

2022-12-27 Thread Clément Bœsch
This is following the results from personal research¹. ¹: https://github.com/ubitux/research/tree/main/color-quantization#results --- libavfilter/vf_palettegen.c| 42 ++ tests/ref/fate/filter-palettegen-1 | 2 +- tests/ref/fate/filter-palettegen-2 | 2 +- 3 f

[FFmpeg-devel] [PATCH v2 10/32] avfilter/palettegen: move box stats computation to a dedicated function

2022-12-27 Thread Clément Bœsch
--- libavfilter/vf_palettegen.c | 64 ++--- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/libavfilter/vf_palettegen.c b/libavfilter/vf_palettegen.c index bea3292796..a047c75599 100644 --- a/libavfilter/vf_palettegen.c +++ b/libavfilter/vf_palettege

[FFmpeg-devel] [PATCH v2 09/32] avfilter/paletteuse: switch to a perceptual model

2022-12-27 Thread Clément Bœsch
Now the selection of the color is based on a distance built around human perception of color instead of the unreliable sRGB triplet one. --- libavfilter/Makefile| 2 +- libavfilter/vf_paletteuse.c | 181 ++-- tests/ref/fate/filter-paletteus

  1   2   3   4   5   6   7   8   9   10   >