Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] Misc ProRes frame header conformity fixes
@ 2023-12-11 19:06 Clément Bœsch
  2023-12-11 19:06 ` [FFmpeg-devel] [PATCH 1/5] avcodec/proresenc_anatoliy: use a compatible bitstream version Clément Bœsch
                   ` (5 more replies)
  0 siblings, 6 replies; 23+ messages in thread
From: Clément Bœsch @ 2023-12-11 19:06 UTC (permalink / raw)
  To: ffmpeg-devel

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@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [FFmpeg-devel] [PATCH 1/5] avcodec/proresenc_anatoliy: use a compatible bitstream version
  2023-12-11 19:06 [FFmpeg-devel] Misc ProRes frame header conformity fixes Clément Bœsch
@ 2023-12-11 19:06 ` Clément Bœsch
  2023-12-11 19:06 ` [FFmpeg-devel] [PATCH 2/5] avcodec/proresenc_kostya: " Clément Bœsch
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 23+ messages in thread
From: Clément Bœsch @ 2023-12-11 19:06 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: 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
  permissible value may be used for those syntax elements.

So if we're not in 4:2:2 or if there is alpha, we are not allowed to use
version 0.
---
 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 414f52d396..6925dfe4bc 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -747,7 +747,7 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     bytestream_put_be32(&buf, FRAME_ID);
 
     bytestream_put_be16(&buf, header_size);
-    bytestream_put_be16(&buf, 0); /* version */
+    bytestream_put_be16(&buf, avctx->pix_fmt != AV_PIX_FMT_YUV422P10 || ctx->need_alpha ? 1 : 0); /* version */
     bytestream_put_buffer(&buf, ctx->vendor, 4);
     bytestream_put_be16(&buf, avctx->width);
     bytestream_put_be16(&buf, avctx->height);
-- 
2.43.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [FFmpeg-devel] [PATCH 2/5] avcodec/proresenc_kostya: use a compatible bitstream version
  2023-12-11 19:06 [FFmpeg-devel] Misc ProRes frame header conformity fixes Clément Bœsch
  2023-12-11 19:06 ` [FFmpeg-devel] [PATCH 1/5] avcodec/proresenc_anatoliy: use a compatible bitstream version Clément Bœsch
@ 2023-12-11 19:06 ` Clément Bœsch
  2023-12-11 19:06 ` [FFmpeg-devel] [PATCH 3/5] avcodec/proresenc_kostya: do not write into alpha reserved bitfields Clément Bœsch
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 23+ messages in thread
From: Clément Bœsch @ 2023-12-11 19:06 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: 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
  permissible value may be used for those syntax elements.

So if we're not in 4:2:2 or if there is alpha, we are not allowed to use
version 0.
---
 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 05e90bb236..7e660a3708 100644
--- a/libavcodec/proresenc_kostya.c
+++ b/libavcodec/proresenc_kostya.c
@@ -995,7 +995,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     // frame header
     tmp = buf;
     buf += 2;                                   // frame header size will be stored here
-    bytestream_put_be16  (&buf, 0);             // version 1
+    bytestream_put_be16  (&buf, ctx->chroma_factor != CFACTOR_Y422 || ctx->alpha_bits ? 1 : 0);
     bytestream_put_buffer(&buf, ctx->vendor, 4);
     bytestream_put_be16  (&buf, avctx->width);
     bytestream_put_be16  (&buf, avctx->height);
-- 
2.43.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [FFmpeg-devel] [PATCH 3/5] avcodec/proresenc_kostya: do not write into alpha reserved bitfields
  2023-12-11 19:06 [FFmpeg-devel] Misc ProRes frame header conformity fixes Clément Bœsch
  2023-12-11 19:06 ` [FFmpeg-devel] [PATCH 1/5] avcodec/proresenc_anatoliy: use a compatible bitstream version Clément Bœsch
  2023-12-11 19:06 ` [FFmpeg-devel] [PATCH 2/5] avcodec/proresenc_kostya: " Clément Bœsch
@ 2023-12-11 19:06 ` Clément Bœsch
  2023-12-12 23:13   ` Michael Niedermayer
  2023-12-11 19:06 ` [FFmpeg-devel] [PATCH 4/5] avcodec/proresenc_anatoliy: " Clément Bœsch
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 23+ messages in thread
From: Clément Bœsch @ 2023-12-11 19:06 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: 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 4 initial bits are reserved.
---
 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 7e660a3708..a71452466e 100644
--- a/libavcodec/proresenc_kostya.c
+++ b/libavcodec/proresenc_kostya.c
@@ -1009,7 +1009,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     bytestream_put_byte  (&buf, pic->color_primaries);
     bytestream_put_byte  (&buf, pic->color_trc);
     bytestream_put_byte  (&buf, pic->colorspace);
-    bytestream_put_byte  (&buf, 0x40 | (ctx->alpha_bits >> 3));
+    bytestream_put_byte  (&buf, ctx->alpha_bits >> 3);
     bytestream_put_byte  (&buf, 0);             // reserved
     if (ctx->quant_sel != QUANT_MAT_DEFAULT) {
         bytestream_put_byte  (&buf, 0x03);      // matrix flags - both matrices are present
-- 
2.43.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [FFmpeg-devel] [PATCH 4/5] avcodec/proresenc_anatoliy: do not write into alpha reserved bitfields
  2023-12-11 19:06 [FFmpeg-devel] Misc ProRes frame header conformity fixes Clément Bœsch
                   ` (2 preceding siblings ...)
  2023-12-11 19:06 ` [FFmpeg-devel] [PATCH 3/5] avcodec/proresenc_kostya: do not write into alpha reserved bitfields Clément Bœsch
@ 2023-12-11 19:06 ` Clément Bœsch
  2023-12-11 19:06 ` [FFmpeg-devel] [PATCH 5/5] avcodec/proresenc_anatoliy: do not write into chroma " Clément Bœsch
  2024-01-07 18:16 ` [FFmpeg-devel] [PATCH 1/5] avcodec/proresenc_anatoliy: use a compatible bitstream version Clément Bœsch
  5 siblings, 0 replies; 23+ messages in thread
From: Clément Bœsch @ 2023-12-11 19:06 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: 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_anatoliy.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index 6925dfe4bc..727199ed3b 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -776,15 +776,8 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
                                       pict->color_trc, valid_trc, 0);
     *buf++ = int_from_list_or_default(avctx, "frame colorspace",
                                       pict->colorspace, valid_colorspace, 0);
-    if (avctx->profile >= AV_PROFILE_PRORES_4444) {
-        if (avctx->pix_fmt == AV_PIX_FMT_YUV444P10) {
-            *buf++ = 0xA0;/* src b64a and no alpha */
-        } else {
-            *buf++ = 0xA2;/* src b64a and 16b alpha */
-        }
-    } else {
-        *buf++ = 32;/* src v210 and no alpha */
-    }
+    if (ctx->need_alpha)
+        *buf++ = 0x2; /* 16-bit alpha */
     *buf++ = 0; /* reserved */
     *buf++ = 3; /* luma and chroma matrix present */
 
-- 
2.43.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [FFmpeg-devel] [PATCH 5/5] avcodec/proresenc_anatoliy: do not write into chroma reserved bitfields
  2023-12-11 19:06 [FFmpeg-devel] Misc ProRes frame header conformity fixes Clément Bœsch
                   ` (3 preceding siblings ...)
  2023-12-11 19:06 ` [FFmpeg-devel] [PATCH 4/5] avcodec/proresenc_anatoliy: " Clément Bœsch
@ 2023-12-11 19:06 ` Clément Bœsch
  2024-01-07 18:16 ` [FFmpeg-devel] [PATCH 1/5] avcodec/proresenc_anatoliy: use a compatible bitstream version Clément Bœsch
  5 siblings, 0 replies; 23+ messages in thread
From: Clément Bœsch @ 2023-12-11 19:06 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: 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: bff
   3: reserved

0x80 is what we expect for "422 not interlaced", and the extra 0x2 from
0x82 is actually writting into the reserved bits.
---
 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 727199ed3b..7c2ec7b3fe 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -751,7 +751,7 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     bytestream_put_buffer(&buf, ctx->vendor, 4);
     bytestream_put_be16(&buf, avctx->width);
     bytestream_put_be16(&buf, avctx->height);
-    frame_flags = 0x82; /* 422 not interlaced */
+    frame_flags = 0x80; /* 422 not interlaced */
     if (avctx->profile >= AV_PROFILE_PRORES_4444) /* 4444 or 4444 Xq */
         frame_flags |= 0x40; /* 444 chroma */
     if (ctx->is_interlaced) {
-- 
2.43.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [FFmpeg-devel] [PATCH 3/5] avcodec/proresenc_kostya: do not write into alpha reserved bitfields
  2023-12-11 19:06 ` [FFmpeg-devel] [PATCH 3/5] avcodec/proresenc_kostya: do not write into alpha reserved bitfields Clément Bœsch
@ 2023-12-12 23:13   ` Michael Niedermayer
  2023-12-12 23:16     ` Michael Niedermayer
  0 siblings, 1 reply; 23+ messages in thread
From: Michael Niedermayer @ 2023-12-12 23:13 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 1397 bytes --]

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_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 4 initial bits are reserved.
> ---
>  libavcodec/proresenc_kostya.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

This breaks fate (not just changing the value but actually breaking it)

--- ./tests/ref/vsynth/vsynth1-prores_444_int	2023-12-02 00:46:44.277042842 +0100
+++ tests/data/fate/vsynth1-prores_444_int	2023-12-13 00:11:22.144115839 +0100
@@ -1,4 +1,2 @@
-1d5e484fa8ca08781ef2ed8428963d12 *tests/data/fate/vsynth1-prores_444_int.mov
+d75a2ba07d0642340d040edab6cbb3bb *tests/data/fate/vsynth1-prores_444_int.mov
 9940947 tests/data/fate/vsynth1-prores_444_int.mov
-732ceeb6887524e0aee98762fe50578b *tests/data/fate/vsynth1-prores_444_int.out.rawvideo
-stddev:    2.83 PSNR: 39.08 MAXDIFF:   45 bytes:  7603200/  7603200

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [FFmpeg-devel] [PATCH 3/5] avcodec/proresenc_kostya: do not write into alpha reserved bitfields
  2023-12-12 23:13   ` Michael Niedermayer
@ 2023-12-12 23:16     ` Michael Niedermayer
  2024-01-07 18:20       ` Clément Bœsch
  0 siblings, 1 reply; 23+ messages in thread
From: Michael Niedermayer @ 2023-12-12 23:16 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 1704 bytes --]

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_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 4 initial bits are reserved.
> > ---
> >  libavcodec/proresenc_kostya.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> This breaks fate (not just changing the value but actually breaking it)

This is about the next patch "avcodec/proresenc_anatoliy: do not write into alpha reserved bitfields"
I used a too short search string for the subject i replied to ...
(so issue is real but its the next patch)


> 
> --- ./tests/ref/vsynth/vsynth1-prores_444_int	2023-12-02 00:46:44.277042842 +0100
> +++ tests/data/fate/vsynth1-prores_444_int	2023-12-13 00:11:22.144115839 +0100
> @@ -1,4 +1,2 @@
> -1d5e484fa8ca08781ef2ed8428963d12 *tests/data/fate/vsynth1-prores_444_int.mov
> +d75a2ba07d0642340d040edab6cbb3bb *tests/data/fate/vsynth1-prores_444_int.mov
>  9940947 tests/data/fate/vsynth1-prores_444_int.mov
> -732ceeb6887524e0aee98762fe50578b *tests/data/fate/vsynth1-prores_444_int.out.rawvideo
> -stddev:    2.83 PSNR: 39.08 MAXDIFF:   45 bytes:  7603200/  7603200

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Some people wanted to paint the bikeshed green, some blue and some pink.
People argued and fought, when they finally agreed, only rust was left.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [FFmpeg-devel] [PATCH 1/5] avcodec/proresenc_anatoliy: use a compatible bitstream version
  2023-12-11 19:06 [FFmpeg-devel] Misc ProRes frame header conformity fixes Clément Bœsch
                   ` (4 preceding siblings ...)
  2023-12-11 19:06 ` [FFmpeg-devel] [PATCH 5/5] avcodec/proresenc_anatoliy: do not write into chroma " Clément Bœsch
@ 2024-01-07 18:16 ` Clément Bœsch
  2024-01-07 18:16   ` [FFmpeg-devel] [PATCH 2/5] avcodec/proresenc_kostya: " Clément Bœsch
                     ` (4 more replies)
  5 siblings, 5 replies; 23+ messages in thread
From: Clément Bœsch @ 2024-01-07 18:16 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: 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
  permissible value may be used for those syntax elements.

So if we're not in 4:2:2 or if there is alpha, we are not allowed to use
version 0.
---
 libavcodec/proresenc_anatoliy.c             | 2 +-
 tests/ref/vsynth/vsynth1-prores_444         | 2 +-
 tests/ref/vsynth/vsynth1-prores_444_int     | 2 +-
 tests/ref/vsynth/vsynth2-prores_444         | 2 +-
 tests/ref/vsynth/vsynth2-prores_444_int     | 2 +-
 tests/ref/vsynth/vsynth3-prores_444         | 2 +-
 tests/ref/vsynth/vsynth3-prores_444_int     | 2 +-
 tests/ref/vsynth/vsynth_lena-prores_444     | 2 +-
 tests/ref/vsynth/vsynth_lena-prores_444_int | 2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index 9b9ffa03be..2223721aa0 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -765,7 +765,7 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     bytestream_put_buffer(&buf, "icpf", 4);
 
     bytestream_put_be16(&buf, header_size);
-    bytestream_put_be16(&buf, 0); /* version */
+    bytestream_put_be16(&buf, avctx->pix_fmt != AV_PIX_FMT_YUV422P10 || ctx->need_alpha ? 1 : 0); /* version */
     bytestream_put_buffer(&buf, ctx->vendor, 4);
     bytestream_put_be16(&buf, avctx->width);
     bytestream_put_be16(&buf, avctx->height);
diff --git a/tests/ref/vsynth/vsynth1-prores_444 b/tests/ref/vsynth/vsynth1-prores_444
index f7f8e9033d..54a63348ad 100644
--- a/tests/ref/vsynth/vsynth1-prores_444
+++ b/tests/ref/vsynth/vsynth1-prores_444
@@ -1,4 +1,4 @@
-509e0407dff118c775dcaa4f509a4aae *tests/data/fate/vsynth1-prores_444.mov
+17c5652215ee8213319f58bc6bbcc505 *tests/data/fate/vsynth1-prores_444.mov
 7778954 tests/data/fate/vsynth1-prores_444.mov
 e0da52b5d58171294d1b299539801ae0 *tests/data/fate/vsynth1-prores_444.out.rawvideo
 stddev:    2.80 PSNR: 39.17 MAXDIFF:   44 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth1-prores_444_int b/tests/ref/vsynth/vsynth1-prores_444_int
index 9515887212..9268099c7b 100644
--- a/tests/ref/vsynth/vsynth1-prores_444_int
+++ b/tests/ref/vsynth/vsynth1-prores_444_int
@@ -1,4 +1,4 @@
-1d5e484fa8ca08781ef2ed8428963d12 *tests/data/fate/vsynth1-prores_444_int.mov
+41cc25faabf5545b84983d43cc46aded *tests/data/fate/vsynth1-prores_444_int.mov
 9940947 tests/data/fate/vsynth1-prores_444_int.mov
 732ceeb6887524e0aee98762fe50578b *tests/data/fate/vsynth1-prores_444_int.out.rawvideo
 stddev:    2.83 PSNR: 39.08 MAXDIFF:   45 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-prores_444 b/tests/ref/vsynth/vsynth2-prores_444
index c6084f5908..c1e8109cc8 100644
--- a/tests/ref/vsynth/vsynth2-prores_444
+++ b/tests/ref/vsynth/vsynth2-prores_444
@@ -1,4 +1,4 @@
-21f973c4c6076ea21f82d5fe486c0c98 *tests/data/fate/vsynth2-prores_444.mov
+9b2e73b60b1809754390f3d6bcd65218 *tests/data/fate/vsynth2-prores_444.mov
 5219722 tests/data/fate/vsynth2-prores_444.mov
 e425b6af7afa51b5e64fc529528b3691 *tests/data/fate/vsynth2-prores_444.out.rawvideo
 stddev:    0.88 PSNR: 49.18 MAXDIFF:   14 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-prores_444_int b/tests/ref/vsynth/vsynth2-prores_444_int
index a727bb2d23..968a4ed7e1 100644
--- a/tests/ref/vsynth/vsynth2-prores_444_int
+++ b/tests/ref/vsynth/vsynth2-prores_444_int
@@ -1,4 +1,4 @@
-500a8249bc63ec6bb79f816bce5b6db1 *tests/data/fate/vsynth2-prores_444_int.mov
+dbb3038d8fc88d7261a7aad315196600 *tests/data/fate/vsynth2-prores_444_int.mov
 6420787 tests/data/fate/vsynth2-prores_444_int.mov
 33a5db4f0423168d4ae4f1db3610928e *tests/data/fate/vsynth2-prores_444_int.out.rawvideo
 stddev:    0.93 PSNR: 48.73 MAXDIFF:   14 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth3-prores_444 b/tests/ref/vsynth/vsynth3-prores_444
index f05894b33e..5a1614ef5a 100644
--- a/tests/ref/vsynth/vsynth3-prores_444
+++ b/tests/ref/vsynth/vsynth3-prores_444
@@ -1,4 +1,4 @@
-3070da65c30c1a9905ee31c7ede1cf57 *tests/data/fate/vsynth3-prores_444.mov
+07d2ba443bd0a2ae090dd85cc8d9423e *tests/data/fate/vsynth3-prores_444.mov
 159127 tests/data/fate/vsynth3-prores_444.mov
 025b48feb3d9a9652983ef71e6cb7e7c *tests/data/fate/vsynth3-prores_444.out.rawvideo
 stddev:    3.21 PSNR: 37.98 MAXDIFF:   41 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth3-prores_444_int b/tests/ref/vsynth/vsynth3-prores_444_int
index f6ba6bc282..d9127ffd17 100644
--- a/tests/ref/vsynth/vsynth3-prores_444_int
+++ b/tests/ref/vsynth/vsynth3-prores_444_int
@@ -1,4 +1,4 @@
-c6279e0584575ffa1e2e13047cc7ecec *tests/data/fate/vsynth3-prores_444_int.mov
+a97bdacf54af3f81610861f2ba613bc7 *tests/data/fate/vsynth3-prores_444_int.mov
 184397 tests/data/fate/vsynth3-prores_444_int.mov
 a8852aa2841c2ce5f2aa86176ceda4ef *tests/data/fate/vsynth3-prores_444_int.out.rawvideo
 stddev:    3.24 PSNR: 37.91 MAXDIFF:   41 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth_lena-prores_444 b/tests/ref/vsynth/vsynth_lena-prores_444
index 29141239c5..0c6323bdb9 100644
--- a/tests/ref/vsynth/vsynth_lena-prores_444
+++ b/tests/ref/vsynth/vsynth_lena-prores_444
@@ -1,4 +1,4 @@
-b8677f9e1da7be861e8b7207028b3a9e *tests/data/fate/vsynth_lena-prores_444.mov
+e14c1dbd26cebe70feda70acb18962c0 *tests/data/fate/vsynth_lena-prores_444.mov
 4734395 tests/data/fate/vsynth_lena-prores_444.mov
 a704e05e3e0a451edef7515b25a76bb8 *tests/data/fate/vsynth_lena-prores_444.out.rawvideo
 stddev:    0.81 PSNR: 49.88 MAXDIFF:    8 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth_lena-prores_444_int b/tests/ref/vsynth/vsynth_lena-prores_444_int
index 005ab68ccf..f8840973a0 100644
--- a/tests/ref/vsynth/vsynth_lena-prores_444_int
+++ b/tests/ref/vsynth/vsynth_lena-prores_444_int
@@ -1,4 +1,4 @@
-38195b0437f6ae1c910ba108e7a799d1 *tests/data/fate/vsynth_lena-prores_444_int.mov
+7a1aa9e220dffde91c3a9a0595261461 *tests/data/fate/vsynth_lena-prores_444_int.mov
 5696258 tests/data/fate/vsynth_lena-prores_444_int.mov
 466380156e4d2b811f4ffb9c5a8bca72 *tests/data/fate/vsynth_lena-prores_444_int.out.rawvideo
 stddev:    0.88 PSNR: 49.23 MAXDIFF:    9 bytes:  7603200/  7603200
-- 
2.43.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [FFmpeg-devel] [PATCH 2/5] avcodec/proresenc_kostya: use a compatible bitstream version
  2024-01-07 18:16 ` [FFmpeg-devel] [PATCH 1/5] avcodec/proresenc_anatoliy: use a compatible bitstream version Clément Bœsch
@ 2024-01-07 18:16   ` Clément Bœsch
  2024-01-08 19:57     ` Stefano Sabatini
  2024-01-07 18:16   ` [FFmpeg-devel] [PATCH 3/5] avcodec/proresenc_kostya: do not write into alpha reserved bitfields Clément Bœsch
                     ` (3 subsequent siblings)
  4 siblings, 1 reply; 23+ messages in thread
From: Clément Bœsch @ 2024-01-07 18:16 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: 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
  permissible value may be used for those syntax elements.

So if we're not in 4:2:2 or if there is alpha, we are not allowed to use
version 0.
---
 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 8d45e42d1a..de63127192 100644
--- a/libavcodec/proresenc_kostya.c
+++ b/libavcodec/proresenc_kostya.c
@@ -1037,7 +1037,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     // frame header
     tmp = buf;
     buf += 2;                                   // frame header size will be stored here
-    bytestream_put_be16  (&buf, 0);             // version 1
+    bytestream_put_be16  (&buf, ctx->chroma_factor != CFACTOR_Y422 || ctx->alpha_bits ? 1 : 0);
     bytestream_put_buffer(&buf, ctx->vendor, 4);
     bytestream_put_be16  (&buf, avctx->width);
     bytestream_put_be16  (&buf, avctx->height);
-- 
2.43.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [FFmpeg-devel] [PATCH 3/5] avcodec/proresenc_kostya: do not write into alpha reserved bitfields
  2024-01-07 18:16 ` [FFmpeg-devel] [PATCH 1/5] avcodec/proresenc_anatoliy: use a compatible bitstream version Clément Bœsch
  2024-01-07 18:16   ` [FFmpeg-devel] [PATCH 2/5] avcodec/proresenc_kostya: " Clément Bœsch
@ 2024-01-07 18:16   ` Clément Bœsch
  2024-01-08 20:10     ` Stefano Sabatini
  2024-01-07 18:16   ` [FFmpeg-devel] [PATCH 4/5] avcodec/proresenc_anatoliy: " Clément Bœsch
                     ` (2 subsequent siblings)
  4 siblings, 1 reply; 23+ messages in thread
From: Clément Bœsch @ 2024-01-07 18:16 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: 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 4 initial bits are reserved.
---
 libavcodec/proresenc_kostya.c          | 2 +-
 tests/ref/vsynth/vsynth1-prores_ks     | 2 +-
 tests/ref/vsynth/vsynth2-prores_ks     | 2 +-
 tests/ref/vsynth/vsynth3-prores_ks     | 2 +-
 tests/ref/vsynth/vsynth_lena-prores_ks | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c
index de63127192..f6c71c2b86 100644
--- a/libavcodec/proresenc_kostya.c
+++ b/libavcodec/proresenc_kostya.c
@@ -1051,7 +1051,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     bytestream_put_byte  (&buf, pic->color_primaries);
     bytestream_put_byte  (&buf, pic->color_trc);
     bytestream_put_byte  (&buf, pic->colorspace);
-    bytestream_put_byte  (&buf, 0x40 | (ctx->alpha_bits >> 3));
+    bytestream_put_byte  (&buf, ctx->alpha_bits >> 3);
     bytestream_put_byte  (&buf, 0);             // reserved
     if (ctx->quant_sel != QUANT_MAT_DEFAULT) {
         bytestream_put_byte  (&buf, 0x03);      // matrix flags - both matrices are present
diff --git a/tests/ref/vsynth/vsynth1-prores_ks b/tests/ref/vsynth/vsynth1-prores_ks
index 22c248909c..a9aa6e41ba 100644
--- a/tests/ref/vsynth/vsynth1-prores_ks
+++ b/tests/ref/vsynth/vsynth1-prores_ks
@@ -1,4 +1,4 @@
-5b0970bacd4b03d70f7648fee2f0c85f *tests/data/fate/vsynth1-prores_ks.mov
+fad50b4a0fb706fb2e282678ed962281 *tests/data/fate/vsynth1-prores_ks.mov
 3858911 tests/data/fate/vsynth1-prores_ks.mov
 100eb002413fe7a632d440dfbdf7e3ff *tests/data/fate/vsynth1-prores_ks.out.rawvideo
 stddev:    3.17 PSNR: 38.09 MAXDIFF:   39 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-prores_ks b/tests/ref/vsynth/vsynth2-prores_ks
index 5186f55b4f..75289491ed 100644
--- a/tests/ref/vsynth/vsynth2-prores_ks
+++ b/tests/ref/vsynth/vsynth2-prores_ks
@@ -1,4 +1,4 @@
-abde4f84a5e4060492e3d8fcb56f2467 *tests/data/fate/vsynth2-prores_ks.mov
+2f909bf4f1262da79dd2fa502cb41853 *tests/data/fate/vsynth2-prores_ks.mov
 3868162 tests/data/fate/vsynth2-prores_ks.mov
 fe7ad707205c6100e9a3956d4e1c300e *tests/data/fate/vsynth2-prores_ks.out.rawvideo
 stddev:    1.17 PSNR: 46.72 MAXDIFF:   14 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth3-prores_ks b/tests/ref/vsynth/vsynth3-prores_ks
index 561ee48dee..f859c9e5f8 100644
--- a/tests/ref/vsynth/vsynth3-prores_ks
+++ b/tests/ref/vsynth/vsynth3-prores_ks
@@ -1,4 +1,4 @@
-f6ce1e8e2272cea0592d3f969d48c1de *tests/data/fate/vsynth3-prores_ks.mov
+3703ae6dea89c9d8b5a8872d8167ca42 *tests/data/fate/vsynth3-prores_ks.mov
 95053 tests/data/fate/vsynth3-prores_ks.mov
 9ab6d3e3cc7749796cd9fa984c60d890 *tests/data/fate/vsynth3-prores_ks.out.rawvideo
 stddev:    4.09 PSNR: 35.88 MAXDIFF:   35 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth_lena-prores_ks b/tests/ref/vsynth/vsynth_lena-prores_ks
index 333578bc1e..c3f91de2c0 100644
--- a/tests/ref/vsynth/vsynth_lena-prores_ks
+++ b/tests/ref/vsynth/vsynth_lena-prores_ks
@@ -1,4 +1,4 @@
-86b9932d5f78d0b5836533e972a37a65 *tests/data/fate/vsynth_lena-prores_ks.mov
+e0822c5ba6ce8825052dfb8dbf98d939 *tests/data/fate/vsynth_lena-prores_ks.mov
 3884596 tests/data/fate/vsynth_lena-prores_ks.mov
 6cfe987de99cf8ac9d43bdc5cd150838 *tests/data/fate/vsynth_lena-prores_ks.out.rawvideo
 stddev:    0.92 PSNR: 48.78 MAXDIFF:   10 bytes:  7603200/  7603200
-- 
2.43.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [FFmpeg-devel] [PATCH 4/5] avcodec/proresenc_anatoliy: do not write into alpha reserved bitfields
  2024-01-07 18:16 ` [FFmpeg-devel] [PATCH 1/5] avcodec/proresenc_anatoliy: use a compatible bitstream version Clément Bœsch
  2024-01-07 18:16   ` [FFmpeg-devel] [PATCH 2/5] avcodec/proresenc_kostya: " Clément Bœsch
  2024-01-07 18:16   ` [FFmpeg-devel] [PATCH 3/5] avcodec/proresenc_kostya: do not write into alpha reserved bitfields Clément Bœsch
@ 2024-01-07 18:16   ` Clément Bœsch
  2024-01-08 20:23     ` Stefano Sabatini
  2024-01-07 18:16   ` [FFmpeg-devel] [PATCH 5/5] avcodec/proresenc_anatoliy: do not write into chroma " Clément Bœsch
  2024-01-08 19:54   ` [FFmpeg-devel] [PATCH 1/5] avcodec/proresenc_anatoliy: use a compatible bitstream version Stefano Sabatini
  4 siblings, 1 reply; 23+ messages in thread
From: Clément Bœsch @ 2024-01-07 18:16 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: 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_anatoliy.c             | 10 +---------
 tests/ref/vsynth/vsynth1-prores             |  2 +-
 tests/ref/vsynth/vsynth1-prores_444         |  2 +-
 tests/ref/vsynth/vsynth1-prores_444_int     |  2 +-
 tests/ref/vsynth/vsynth1-prores_int         |  2 +-
 tests/ref/vsynth/vsynth2-prores             |  2 +-
 tests/ref/vsynth/vsynth2-prores_444         |  2 +-
 tests/ref/vsynth/vsynth2-prores_444_int     |  2 +-
 tests/ref/vsynth/vsynth2-prores_int         |  2 +-
 tests/ref/vsynth/vsynth3-prores             |  2 +-
 tests/ref/vsynth/vsynth3-prores_444         |  2 +-
 tests/ref/vsynth/vsynth3-prores_444_int     |  2 +-
 tests/ref/vsynth/vsynth3-prores_int         |  2 +-
 tests/ref/vsynth/vsynth_lena-prores         |  2 +-
 tests/ref/vsynth/vsynth_lena-prores_444     |  2 +-
 tests/ref/vsynth/vsynth_lena-prores_444_int |  2 +-
 tests/ref/vsynth/vsynth_lena-prores_int     |  2 +-
 17 files changed, 17 insertions(+), 25 deletions(-)

diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index 2223721aa0..1112cb26f1 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -794,15 +794,7 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
                                       pict->color_trc, valid_trc, 0);
     *buf++ = int_from_list_or_default(avctx, "frame colorspace",
                                       pict->colorspace, valid_colorspace, 0);
-    if (avctx->profile >= AV_PROFILE_PRORES_4444) {
-        if (avctx->pix_fmt == AV_PIX_FMT_YUV444P10) {
-            *buf++ = 0xA0;/* src b64a and no alpha */
-        } else {
-            *buf++ = 0xA2;/* src b64a and 16b alpha */
-        }
-    } else {
-        *buf++ = 32;/* src v210 and no alpha */
-    }
+    *buf++ = ctx->need_alpha ? 0x2 /* 16-bit alpha */ : 0;
     *buf++ = 0; /* reserved */
     *buf++ = 3; /* luma and chroma matrix present */
 
diff --git a/tests/ref/vsynth/vsynth1-prores b/tests/ref/vsynth/vsynth1-prores
index 3c59eb71a8..52ac4e250a 100644
--- a/tests/ref/vsynth/vsynth1-prores
+++ b/tests/ref/vsynth/vsynth1-prores
@@ -1,4 +1,4 @@
-460f69344752e6af2dc46b00169b78a3 *tests/data/fate/vsynth1-prores.mov
+816d6e42260509681c49398cd4aa38a4 *tests/data/fate/vsynth1-prores.mov
 5022821 tests/data/fate/vsynth1-prores.mov
 fb4a9e025d12afc0dbbca8d82831858f *tests/data/fate/vsynth1-prores.out.rawvideo
 stddev:    2.47 PSNR: 40.27 MAXDIFF:   31 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth1-prores_444 b/tests/ref/vsynth/vsynth1-prores_444
index 54a63348ad..d4a8c4d33d 100644
--- a/tests/ref/vsynth/vsynth1-prores_444
+++ b/tests/ref/vsynth/vsynth1-prores_444
@@ -1,4 +1,4 @@
-17c5652215ee8213319f58bc6bbcc505 *tests/data/fate/vsynth1-prores_444.mov
+722dde50fce82923b81748ad8c64ca8d *tests/data/fate/vsynth1-prores_444.mov
 7778954 tests/data/fate/vsynth1-prores_444.mov
 e0da52b5d58171294d1b299539801ae0 *tests/data/fate/vsynth1-prores_444.out.rawvideo
 stddev:    2.80 PSNR: 39.17 MAXDIFF:   44 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth1-prores_444_int b/tests/ref/vsynth/vsynth1-prores_444_int
index 9268099c7b..9443e5e5a7 100644
--- a/tests/ref/vsynth/vsynth1-prores_444_int
+++ b/tests/ref/vsynth/vsynth1-prores_444_int
@@ -1,4 +1,4 @@
-41cc25faabf5545b84983d43cc46aded *tests/data/fate/vsynth1-prores_444_int.mov
+c7e7c65147f68893d735b650efec9ed3 *tests/data/fate/vsynth1-prores_444_int.mov
 9940947 tests/data/fate/vsynth1-prores_444_int.mov
 732ceeb6887524e0aee98762fe50578b *tests/data/fate/vsynth1-prores_444_int.out.rawvideo
 stddev:    2.83 PSNR: 39.08 MAXDIFF:   45 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth1-prores_int b/tests/ref/vsynth/vsynth1-prores_int
index 16a66874af..46c9b2ff4e 100644
--- a/tests/ref/vsynth/vsynth1-prores_int
+++ b/tests/ref/vsynth/vsynth1-prores_int
@@ -1,4 +1,4 @@
-3711e22aa5052f39dabfcb9ee3a42045 *tests/data/fate/vsynth1-prores_int.mov
+3ffa73e7ecd5c2f9a2bd2098499e22a5 *tests/data/fate/vsynth1-prores_int.mov
 6308688 tests/data/fate/vsynth1-prores_int.mov
 164a4ca890695cf594293d1acec9463c *tests/data/fate/vsynth1-prores_int.out.rawvideo
 stddev:    2.66 PSNR: 39.62 MAXDIFF:   34 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-prores b/tests/ref/vsynth/vsynth2-prores
index 8e48cb041c..37d0bd923d 100644
--- a/tests/ref/vsynth/vsynth2-prores
+++ b/tests/ref/vsynth/vsynth2-prores
@@ -1,4 +1,4 @@
-a38660faa093dbc8a1ae8e570b6e595b *tests/data/fate/vsynth2-prores.mov
+a3815327670b2c893045d0bf1b1da9b5 *tests/data/fate/vsynth2-prores.mov
 3260123 tests/data/fate/vsynth2-prores.mov
 416fa8773615889c70491452428d6710 *tests/data/fate/vsynth2-prores.out.rawvideo
 stddev:    1.38 PSNR: 45.29 MAXDIFF:   12 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-prores_444 b/tests/ref/vsynth/vsynth2-prores_444
index c1e8109cc8..d0a033de40 100644
--- a/tests/ref/vsynth/vsynth2-prores_444
+++ b/tests/ref/vsynth/vsynth2-prores_444
@@ -1,4 +1,4 @@
-9b2e73b60b1809754390f3d6bcd65218 *tests/data/fate/vsynth2-prores_444.mov
+ab3646c0599b116b533c5b7f78741cac *tests/data/fate/vsynth2-prores_444.mov
 5219722 tests/data/fate/vsynth2-prores_444.mov
 e425b6af7afa51b5e64fc529528b3691 *tests/data/fate/vsynth2-prores_444.out.rawvideo
 stddev:    0.88 PSNR: 49.18 MAXDIFF:   14 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-prores_444_int b/tests/ref/vsynth/vsynth2-prores_444_int
index 968a4ed7e1..4f2dad5b0e 100644
--- a/tests/ref/vsynth/vsynth2-prores_444_int
+++ b/tests/ref/vsynth/vsynth2-prores_444_int
@@ -1,4 +1,4 @@
-dbb3038d8fc88d7261a7aad315196600 *tests/data/fate/vsynth2-prores_444_int.mov
+e8dc9c3d56af3f382ae2d9de4dad095f *tests/data/fate/vsynth2-prores_444_int.mov
 6420787 tests/data/fate/vsynth2-prores_444_int.mov
 33a5db4f0423168d4ae4f1db3610928e *tests/data/fate/vsynth2-prores_444_int.out.rawvideo
 stddev:    0.93 PSNR: 48.73 MAXDIFF:   14 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-prores_int b/tests/ref/vsynth/vsynth2-prores_int
index 0f27acdca0..1b2786cd58 100644
--- a/tests/ref/vsynth/vsynth2-prores_int
+++ b/tests/ref/vsynth/vsynth2-prores_int
@@ -1,4 +1,4 @@
-dd7835992e7a30b7be9014916411b5b3 *tests/data/fate/vsynth2-prores_int.mov
+2470bebd9dd05dabe02ff4555ed747f8 *tests/data/fate/vsynth2-prores_int.mov
 4070996 tests/data/fate/vsynth2-prores_int.mov
 bef9e38387a1fbb1ce2e4401b6d41674 *tests/data/fate/vsynth2-prores_int.out.rawvideo
 stddev:    1.54 PSNR: 44.37 MAXDIFF:   13 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth3-prores b/tests/ref/vsynth/vsynth3-prores
index 8dfaf09d26..39023d479c 100644
--- a/tests/ref/vsynth/vsynth3-prores
+++ b/tests/ref/vsynth/vsynth3-prores
@@ -1,4 +1,4 @@
-3e6f1fd0e4fdad4a8dd351dec08b0bf5 *tests/data/fate/vsynth3-prores.mov
+a7c499437e66fbfb1fe96f5eba326610 *tests/data/fate/vsynth3-prores.mov
 105367 tests/data/fate/vsynth3-prores.mov
 fff5e7ad21d78501c8fa4749bf4bf289 *tests/data/fate/vsynth3-prores.out.rawvideo
 stddev:    2.80 PSNR: 39.17 MAXDIFF:   27 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth3-prores_444 b/tests/ref/vsynth/vsynth3-prores_444
index 5a1614ef5a..7427fe9fd6 100644
--- a/tests/ref/vsynth/vsynth3-prores_444
+++ b/tests/ref/vsynth/vsynth3-prores_444
@@ -1,4 +1,4 @@
-07d2ba443bd0a2ae090dd85cc8d9423e *tests/data/fate/vsynth3-prores_444.mov
+23f4ad11002ece9b864cfeeb4bff51a7 *tests/data/fate/vsynth3-prores_444.mov
 159127 tests/data/fate/vsynth3-prores_444.mov
 025b48feb3d9a9652983ef71e6cb7e7c *tests/data/fate/vsynth3-prores_444.out.rawvideo
 stddev:    3.21 PSNR: 37.98 MAXDIFF:   41 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth3-prores_444_int b/tests/ref/vsynth/vsynth3-prores_444_int
index d9127ffd17..e0087510da 100644
--- a/tests/ref/vsynth/vsynth3-prores_444_int
+++ b/tests/ref/vsynth/vsynth3-prores_444_int
@@ -1,4 +1,4 @@
-a97bdacf54af3f81610861f2ba613bc7 *tests/data/fate/vsynth3-prores_444_int.mov
+fb4f7ddf139f2da095335026e4be9585 *tests/data/fate/vsynth3-prores_444_int.mov
 184397 tests/data/fate/vsynth3-prores_444_int.mov
 a8852aa2841c2ce5f2aa86176ceda4ef *tests/data/fate/vsynth3-prores_444_int.out.rawvideo
 stddev:    3.24 PSNR: 37.91 MAXDIFF:   41 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth3-prores_int b/tests/ref/vsynth/vsynth3-prores_int
index c9b8ba691d..817d19feee 100644
--- a/tests/ref/vsynth/vsynth3-prores_int
+++ b/tests/ref/vsynth/vsynth3-prores_int
@@ -1,4 +1,4 @@
-6085fc27cc6cc7c02abc59ce914d85cb *tests/data/fate/vsynth3-prores_int.mov
+db1ca2743b60dc1c3c49fab0dfca6145 *tests/data/fate/vsynth3-prores_int.mov
 120484 tests/data/fate/vsynth3-prores_int.mov
 e5859ba47a99f9e53c1ddcaa68a8f8f8 *tests/data/fate/vsynth3-prores_int.out.rawvideo
 stddev:    2.92 PSNR: 38.81 MAXDIFF:   29 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth_lena-prores b/tests/ref/vsynth/vsynth_lena-prores
index 573fc1273e..b2df8ab914 100644
--- a/tests/ref/vsynth/vsynth_lena-prores
+++ b/tests/ref/vsynth/vsynth_lena-prores
@@ -1,4 +1,4 @@
-eed04261f5d5878ea3b91321420270a0 *tests/data/fate/vsynth_lena-prores.mov
+d9cba10c23c0935ae2774bccee273664 *tests/data/fate/vsynth_lena-prores.mov
 2844076 tests/data/fate/vsynth_lena-prores.mov
 03fd29e3963716a09d232b6f817ecb57 *tests/data/fate/vsynth_lena-prores.out.rawvideo
 stddev:    1.31 PSNR: 45.77 MAXDIFF:   11 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth_lena-prores_444 b/tests/ref/vsynth/vsynth_lena-prores_444
index 0c6323bdb9..5df5fab9f6 100644
--- a/tests/ref/vsynth/vsynth_lena-prores_444
+++ b/tests/ref/vsynth/vsynth_lena-prores_444
@@ -1,4 +1,4 @@
-e14c1dbd26cebe70feda70acb18962c0 *tests/data/fate/vsynth_lena-prores_444.mov
+0818f09f8250dc8030ae6ef1dcdba90d *tests/data/fate/vsynth_lena-prores_444.mov
 4734395 tests/data/fate/vsynth_lena-prores_444.mov
 a704e05e3e0a451edef7515b25a76bb8 *tests/data/fate/vsynth_lena-prores_444.out.rawvideo
 stddev:    0.81 PSNR: 49.88 MAXDIFF:    8 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth_lena-prores_444_int b/tests/ref/vsynth/vsynth_lena-prores_444_int
index f8840973a0..df64464439 100644
--- a/tests/ref/vsynth/vsynth_lena-prores_444_int
+++ b/tests/ref/vsynth/vsynth_lena-prores_444_int
@@ -1,4 +1,4 @@
-7a1aa9e220dffde91c3a9a0595261461 *tests/data/fate/vsynth_lena-prores_444_int.mov
+b8545710824cd87b51ebe223513cc9af *tests/data/fate/vsynth_lena-prores_444_int.mov
 5696258 tests/data/fate/vsynth_lena-prores_444_int.mov
 466380156e4d2b811f4ffb9c5a8bca72 *tests/data/fate/vsynth_lena-prores_444_int.out.rawvideo
 stddev:    0.88 PSNR: 49.23 MAXDIFF:    9 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth_lena-prores_int b/tests/ref/vsynth/vsynth_lena-prores_int
index 3e31b018d7..64cc7db314 100644
--- a/tests/ref/vsynth/vsynth_lena-prores_int
+++ b/tests/ref/vsynth/vsynth_lena-prores_int
@@ -1,4 +1,4 @@
-f45bc9026780bbbcdbbcc0d54c21ef06 *tests/data/fate/vsynth_lena-prores_int.mov
+3d5956899538737305edb383443b8a9a *tests/data/fate/vsynth_lena-prores_int.mov
 3532698 tests/data/fate/vsynth_lena-prores_int.mov
 eb5caa9824ca294f403cd13f33c40f23 *tests/data/fate/vsynth_lena-prores_int.out.rawvideo
 stddev:    1.47 PSNR: 44.78 MAXDIFF:   12 bytes:  7603200/  7603200
-- 
2.43.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [FFmpeg-devel] [PATCH 5/5] avcodec/proresenc_anatoliy: do not write into chroma reserved bitfields
  2024-01-07 18:16 ` [FFmpeg-devel] [PATCH 1/5] avcodec/proresenc_anatoliy: use a compatible bitstream version Clément Bœsch
                     ` (2 preceding siblings ...)
  2024-01-07 18:16   ` [FFmpeg-devel] [PATCH 4/5] avcodec/proresenc_anatoliy: " Clément Bœsch
@ 2024-01-07 18:16   ` Clément Bœsch
  2024-01-10 19:12     ` Clément Bœsch
  2024-01-10 21:43     ` Stefano Sabatini
  2024-01-08 19:54   ` [FFmpeg-devel] [PATCH 1/5] avcodec/proresenc_anatoliy: use a compatible bitstream version Stefano Sabatini
  4 siblings, 2 replies; 23+ messages in thread
From: Clément Bœsch @ 2024-01-07 18:16 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: 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: bff
   3: reserved

0x80 is what we expect for "422 not interlaced", and the extra 0x2 from
0x82 is actually writting into the reserved bits.
---
 libavcodec/proresenc_anatoliy.c             | 2 +-
 tests/ref/vsynth/vsynth1-prores             | 2 +-
 tests/ref/vsynth/vsynth1-prores_444         | 2 +-
 tests/ref/vsynth/vsynth1-prores_444_int     | 2 +-
 tests/ref/vsynth/vsynth1-prores_int         | 2 +-
 tests/ref/vsynth/vsynth2-prores             | 2 +-
 tests/ref/vsynth/vsynth2-prores_444         | 2 +-
 tests/ref/vsynth/vsynth2-prores_444_int     | 2 +-
 tests/ref/vsynth/vsynth2-prores_int         | 2 +-
 tests/ref/vsynth/vsynth3-prores             | 2 +-
 tests/ref/vsynth/vsynth3-prores_444         | 2 +-
 tests/ref/vsynth/vsynth3-prores_444_int     | 2 +-
 tests/ref/vsynth/vsynth3-prores_int         | 2 +-
 tests/ref/vsynth/vsynth_lena-prores         | 2 +-
 tests/ref/vsynth/vsynth_lena-prores_444     | 2 +-
 tests/ref/vsynth/vsynth_lena-prores_444_int | 2 +-
 tests/ref/vsynth/vsynth_lena-prores_int     | 2 +-
 17 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index 1112cb26f1..bee4a14181 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -769,7 +769,7 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     bytestream_put_buffer(&buf, ctx->vendor, 4);
     bytestream_put_be16(&buf, avctx->width);
     bytestream_put_be16(&buf, avctx->height);
-    frame_flags = 0x82; /* 422 not interlaced */
+    frame_flags = 0x80; /* 422 not interlaced */
     if (avctx->profile >= AV_PROFILE_PRORES_4444) /* 4444 or 4444 Xq */
         frame_flags |= 0x40; /* 444 chroma */
     if (ctx->is_interlaced) {
diff --git a/tests/ref/vsynth/vsynth1-prores b/tests/ref/vsynth/vsynth1-prores
index 52ac4e250a..f143611c35 100644
--- a/tests/ref/vsynth/vsynth1-prores
+++ b/tests/ref/vsynth/vsynth1-prores
@@ -1,4 +1,4 @@
-816d6e42260509681c49398cd4aa38a4 *tests/data/fate/vsynth1-prores.mov
+e7c8db829626fdcf30eb9d78cd26b188 *tests/data/fate/vsynth1-prores.mov
 5022821 tests/data/fate/vsynth1-prores.mov
 fb4a9e025d12afc0dbbca8d82831858f *tests/data/fate/vsynth1-prores.out.rawvideo
 stddev:    2.47 PSNR: 40.27 MAXDIFF:   31 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth1-prores_444 b/tests/ref/vsynth/vsynth1-prores_444
index d4a8c4d33d..38ca52b7f7 100644
--- a/tests/ref/vsynth/vsynth1-prores_444
+++ b/tests/ref/vsynth/vsynth1-prores_444
@@ -1,4 +1,4 @@
-722dde50fce82923b81748ad8c64ca8d *tests/data/fate/vsynth1-prores_444.mov
+61238212a797d14763431c346e896277 *tests/data/fate/vsynth1-prores_444.mov
 7778954 tests/data/fate/vsynth1-prores_444.mov
 e0da52b5d58171294d1b299539801ae0 *tests/data/fate/vsynth1-prores_444.out.rawvideo
 stddev:    2.80 PSNR: 39.17 MAXDIFF:   44 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth1-prores_444_int b/tests/ref/vsynth/vsynth1-prores_444_int
index 9443e5e5a7..76db62d4e9 100644
--- a/tests/ref/vsynth/vsynth1-prores_444_int
+++ b/tests/ref/vsynth/vsynth1-prores_444_int
@@ -1,4 +1,4 @@
-c7e7c65147f68893d735b650efec9ed3 *tests/data/fate/vsynth1-prores_444_int.mov
+fd2a2f49c61817c2338f39d5736d5fd2 *tests/data/fate/vsynth1-prores_444_int.mov
 9940947 tests/data/fate/vsynth1-prores_444_int.mov
 732ceeb6887524e0aee98762fe50578b *tests/data/fate/vsynth1-prores_444_int.out.rawvideo
 stddev:    2.83 PSNR: 39.08 MAXDIFF:   45 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth1-prores_int b/tests/ref/vsynth/vsynth1-prores_int
index 46c9b2ff4e..3e2bbeff2a 100644
--- a/tests/ref/vsynth/vsynth1-prores_int
+++ b/tests/ref/vsynth/vsynth1-prores_int
@@ -1,4 +1,4 @@
-3ffa73e7ecd5c2f9a2bd2098499e22a5 *tests/data/fate/vsynth1-prores_int.mov
+1f1b246dfabe028f04c78887e5da51ed *tests/data/fate/vsynth1-prores_int.mov
 6308688 tests/data/fate/vsynth1-prores_int.mov
 164a4ca890695cf594293d1acec9463c *tests/data/fate/vsynth1-prores_int.out.rawvideo
 stddev:    2.66 PSNR: 39.62 MAXDIFF:   34 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-prores b/tests/ref/vsynth/vsynth2-prores
index 37d0bd923d..f170d11110 100644
--- a/tests/ref/vsynth/vsynth2-prores
+++ b/tests/ref/vsynth/vsynth2-prores
@@ -1,4 +1,4 @@
-a3815327670b2c893045d0bf1b1da9b5 *tests/data/fate/vsynth2-prores.mov
+eb1e43e2f323ef3577f43d415a7ede28 *tests/data/fate/vsynth2-prores.mov
 3260123 tests/data/fate/vsynth2-prores.mov
 416fa8773615889c70491452428d6710 *tests/data/fate/vsynth2-prores.out.rawvideo
 stddev:    1.38 PSNR: 45.29 MAXDIFF:   12 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-prores_444 b/tests/ref/vsynth/vsynth2-prores_444
index d0a033de40..f286fe6701 100644
--- a/tests/ref/vsynth/vsynth2-prores_444
+++ b/tests/ref/vsynth/vsynth2-prores_444
@@ -1,4 +1,4 @@
-ab3646c0599b116b533c5b7f78741cac *tests/data/fate/vsynth2-prores_444.mov
+96d4558376927a3dd4eb43e347858fd4 *tests/data/fate/vsynth2-prores_444.mov
 5219722 tests/data/fate/vsynth2-prores_444.mov
 e425b6af7afa51b5e64fc529528b3691 *tests/data/fate/vsynth2-prores_444.out.rawvideo
 stddev:    0.88 PSNR: 49.18 MAXDIFF:   14 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-prores_444_int b/tests/ref/vsynth/vsynth2-prores_444_int
index 4f2dad5b0e..a2ee569c49 100644
--- a/tests/ref/vsynth/vsynth2-prores_444_int
+++ b/tests/ref/vsynth/vsynth2-prores_444_int
@@ -1,4 +1,4 @@
-e8dc9c3d56af3f382ae2d9de4dad095f *tests/data/fate/vsynth2-prores_444_int.mov
+5ac517fc2380a6cf11b7d86d2fafee0a *tests/data/fate/vsynth2-prores_444_int.mov
 6420787 tests/data/fate/vsynth2-prores_444_int.mov
 33a5db4f0423168d4ae4f1db3610928e *tests/data/fate/vsynth2-prores_444_int.out.rawvideo
 stddev:    0.93 PSNR: 48.73 MAXDIFF:   14 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-prores_int b/tests/ref/vsynth/vsynth2-prores_int
index 1b2786cd58..72139ee6c3 100644
--- a/tests/ref/vsynth/vsynth2-prores_int
+++ b/tests/ref/vsynth/vsynth2-prores_int
@@ -1,4 +1,4 @@
-2470bebd9dd05dabe02ff4555ed747f8 *tests/data/fate/vsynth2-prores_int.mov
+4062c74196d95a64e642bd917377ed93 *tests/data/fate/vsynth2-prores_int.mov
 4070996 tests/data/fate/vsynth2-prores_int.mov
 bef9e38387a1fbb1ce2e4401b6d41674 *tests/data/fate/vsynth2-prores_int.out.rawvideo
 stddev:    1.54 PSNR: 44.37 MAXDIFF:   13 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth3-prores b/tests/ref/vsynth/vsynth3-prores
index 39023d479c..7e6776b701 100644
--- a/tests/ref/vsynth/vsynth3-prores
+++ b/tests/ref/vsynth/vsynth3-prores
@@ -1,4 +1,4 @@
-a7c499437e66fbfb1fe96f5eba326610 *tests/data/fate/vsynth3-prores.mov
+23c5b31aa0dd945da6d1b747024c5392 *tests/data/fate/vsynth3-prores.mov
 105367 tests/data/fate/vsynth3-prores.mov
 fff5e7ad21d78501c8fa4749bf4bf289 *tests/data/fate/vsynth3-prores.out.rawvideo
 stddev:    2.80 PSNR: 39.17 MAXDIFF:   27 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth3-prores_444 b/tests/ref/vsynth/vsynth3-prores_444
index 7427fe9fd6..9e8f5e6bc6 100644
--- a/tests/ref/vsynth/vsynth3-prores_444
+++ b/tests/ref/vsynth/vsynth3-prores_444
@@ -1,4 +1,4 @@
-23f4ad11002ece9b864cfeeb4bff51a7 *tests/data/fate/vsynth3-prores_444.mov
+d0a5643716e37ce727b2655bc0c1a497 *tests/data/fate/vsynth3-prores_444.mov
 159127 tests/data/fate/vsynth3-prores_444.mov
 025b48feb3d9a9652983ef71e6cb7e7c *tests/data/fate/vsynth3-prores_444.out.rawvideo
 stddev:    3.21 PSNR: 37.98 MAXDIFF:   41 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth3-prores_444_int b/tests/ref/vsynth/vsynth3-prores_444_int
index e0087510da..ac30691143 100644
--- a/tests/ref/vsynth/vsynth3-prores_444_int
+++ b/tests/ref/vsynth/vsynth3-prores_444_int
@@ -1,4 +1,4 @@
-fb4f7ddf139f2da095335026e4be9585 *tests/data/fate/vsynth3-prores_444_int.mov
+50db4bbc4674de3dfdd41f306af1cb17 *tests/data/fate/vsynth3-prores_444_int.mov
 184397 tests/data/fate/vsynth3-prores_444_int.mov
 a8852aa2841c2ce5f2aa86176ceda4ef *tests/data/fate/vsynth3-prores_444_int.out.rawvideo
 stddev:    3.24 PSNR: 37.91 MAXDIFF:   41 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth3-prores_int b/tests/ref/vsynth/vsynth3-prores_int
index 817d19feee..86fc2266b5 100644
--- a/tests/ref/vsynth/vsynth3-prores_int
+++ b/tests/ref/vsynth/vsynth3-prores_int
@@ -1,4 +1,4 @@
-db1ca2743b60dc1c3c49fab0dfca6145 *tests/data/fate/vsynth3-prores_int.mov
+24b765064b4aec754fdd0cc3658bba19 *tests/data/fate/vsynth3-prores_int.mov
 120484 tests/data/fate/vsynth3-prores_int.mov
 e5859ba47a99f9e53c1ddcaa68a8f8f8 *tests/data/fate/vsynth3-prores_int.out.rawvideo
 stddev:    2.92 PSNR: 38.81 MAXDIFF:   29 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth_lena-prores b/tests/ref/vsynth/vsynth_lena-prores
index b2df8ab914..5c93e931b3 100644
--- a/tests/ref/vsynth/vsynth_lena-prores
+++ b/tests/ref/vsynth/vsynth_lena-prores
@@ -1,4 +1,4 @@
-d9cba10c23c0935ae2774bccee273664 *tests/data/fate/vsynth_lena-prores.mov
+4a4c62c6c425e31c83b3f90875a28d57 *tests/data/fate/vsynth_lena-prores.mov
 2844076 tests/data/fate/vsynth_lena-prores.mov
 03fd29e3963716a09d232b6f817ecb57 *tests/data/fate/vsynth_lena-prores.out.rawvideo
 stddev:    1.31 PSNR: 45.77 MAXDIFF:   11 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth_lena-prores_444 b/tests/ref/vsynth/vsynth_lena-prores_444
index 5df5fab9f6..abbc35ddc3 100644
--- a/tests/ref/vsynth/vsynth_lena-prores_444
+++ b/tests/ref/vsynth/vsynth_lena-prores_444
@@ -1,4 +1,4 @@
-0818f09f8250dc8030ae6ef1dcdba90d *tests/data/fate/vsynth_lena-prores_444.mov
+0b306033702448a7b77513f3e31c522a *tests/data/fate/vsynth_lena-prores_444.mov
 4734395 tests/data/fate/vsynth_lena-prores_444.mov
 a704e05e3e0a451edef7515b25a76bb8 *tests/data/fate/vsynth_lena-prores_444.out.rawvideo
 stddev:    0.81 PSNR: 49.88 MAXDIFF:    8 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth_lena-prores_444_int b/tests/ref/vsynth/vsynth_lena-prores_444_int
index df64464439..f05f1fe775 100644
--- a/tests/ref/vsynth/vsynth_lena-prores_444_int
+++ b/tests/ref/vsynth/vsynth_lena-prores_444_int
@@ -1,4 +1,4 @@
-b8545710824cd87b51ebe223513cc9af *tests/data/fate/vsynth_lena-prores_444_int.mov
+09b5dffd1a484e2152a3b5a0bcceed32 *tests/data/fate/vsynth_lena-prores_444_int.mov
 5696258 tests/data/fate/vsynth_lena-prores_444_int.mov
 466380156e4d2b811f4ffb9c5a8bca72 *tests/data/fate/vsynth_lena-prores_444_int.out.rawvideo
 stddev:    0.88 PSNR: 49.23 MAXDIFF:    9 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth_lena-prores_int b/tests/ref/vsynth/vsynth_lena-prores_int
index 64cc7db314..ea08089745 100644
--- a/tests/ref/vsynth/vsynth_lena-prores_int
+++ b/tests/ref/vsynth/vsynth_lena-prores_int
@@ -1,4 +1,4 @@
-3d5956899538737305edb383443b8a9a *tests/data/fate/vsynth_lena-prores_int.mov
+c7e9a61054f44fe372a3bce619b68ce9 *tests/data/fate/vsynth_lena-prores_int.mov
 3532698 tests/data/fate/vsynth_lena-prores_int.mov
 eb5caa9824ca294f403cd13f33c40f23 *tests/data/fate/vsynth_lena-prores_int.out.rawvideo
 stddev:    1.47 PSNR: 44.78 MAXDIFF:   12 bytes:  7603200/  7603200
-- 
2.43.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [FFmpeg-devel] [PATCH 3/5] avcodec/proresenc_kostya: do not write into alpha reserved bitfields
  2023-12-12 23:16     ` Michael Niedermayer
@ 2024-01-07 18:20       ` Clément Bœsch
  0 siblings, 0 replies; 23+ messages in thread
From: Clément Bœsch @ 2024-01-07 18:20 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

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_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 4 initial bits are reserved.
> > > ---
> > >  libavcodec/proresenc_kostya.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > This breaks fate (not just changing the value but actually breaking it)
> 
> This is about the next patch "avcodec/proresenc_anatoliy: do not write into alpha reserved bitfields"
> I used a too short search string for the subject i replied to ...
> (so issue is real but its the next patch)
> 

Just resent a patchset addressing the FATE issue for all the commits
individually (sorry, I only tested with fate-prores initially)

I also fixed "do not write into alpha reserved bitfields" which wasn't
writing the alpha byte unconditionally.

Sorry about the missing v2 in the patchset btw, forgot about it.

[...]

-- 
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-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/5] avcodec/proresenc_anatoliy: use a compatible bitstream version
  2024-01-07 18:16 ` [FFmpeg-devel] [PATCH 1/5] avcodec/proresenc_anatoliy: use a compatible bitstream version Clément Bœsch
                     ` (3 preceding siblings ...)
  2024-01-07 18:16   ` [FFmpeg-devel] [PATCH 5/5] avcodec/proresenc_anatoliy: do not write into chroma " Clément Bœsch
@ 2024-01-08 19:54   ` Stefano Sabatini
  4 siblings, 0 replies; 23+ messages in thread
From: Stefano Sabatini @ 2024-01-08 19:54 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Clément Bœsch

On date Sunday 2024-01-07 19:16:43 +0100, Clément Bœsch wrote:
> 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
>   permissible value may be used for those syntax elements.
> 
> So if we're not in 4:2:2 or if there is alpha, we are not allowed to use
> version 0.
> ---
>  libavcodec/proresenc_anatoliy.c             | 2 +-
>  tests/ref/vsynth/vsynth1-prores_444         | 2 +-
>  tests/ref/vsynth/vsynth1-prores_444_int     | 2 +-
>  tests/ref/vsynth/vsynth2-prores_444         | 2 +-
>  tests/ref/vsynth/vsynth2-prores_444_int     | 2 +-
>  tests/ref/vsynth/vsynth3-prores_444         | 2 +-
>  tests/ref/vsynth/vsynth3-prores_444_int     | 2 +-
>  tests/ref/vsynth/vsynth_lena-prores_444     | 2 +-
>  tests/ref/vsynth/vsynth_lena-prores_444_int | 2 +-
>  9 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
> index 9b9ffa03be..2223721aa0 100644
> --- a/libavcodec/proresenc_anatoliy.c
> +++ b/libavcodec/proresenc_anatoliy.c
> @@ -765,7 +765,7 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
>      bytestream_put_buffer(&buf, "icpf", 4);
>  
>      bytestream_put_be16(&buf, header_size);
> -    bytestream_put_be16(&buf, 0); /* version */
> +    bytestream_put_be16(&buf, avctx->pix_fmt != AV_PIX_FMT_YUV422P10 || ctx->need_alpha ? 1 : 0); /* version */

LGTM, thanks.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [FFmpeg-devel] [PATCH 2/5] avcodec/proresenc_kostya: use a compatible bitstream version
  2024-01-07 18:16   ` [FFmpeg-devel] [PATCH 2/5] avcodec/proresenc_kostya: " Clément Bœsch
@ 2024-01-08 19:57     ` Stefano Sabatini
  0 siblings, 0 replies; 23+ messages in thread
From: Stefano Sabatini @ 2024-01-08 19:57 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Clément Bœsch

On date Sunday 2024-01-07 19:16:44 +0100, Clément Bœsch wrote:
> 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
>   permissible value may be used for those syntax elements.
> 
> So if we're not in 4:2:2 or if there is alpha, we are not allowed to use
> version 0.
> ---
>  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 8d45e42d1a..de63127192 100644
> --- a/libavcodec/proresenc_kostya.c
> +++ b/libavcodec/proresenc_kostya.c
> @@ -1037,7 +1037,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
>      // frame header
>      tmp = buf;
>      buf += 2;                                   // frame header size will be stored here
> -    bytestream_put_be16  (&buf, 0);             // version 1
> +    bytestream_put_be16  (&buf, ctx->chroma_factor != CFACTOR_Y422 || ctx->alpha_bits ? 1 : 0);

LGTM, thanks.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [FFmpeg-devel] [PATCH 3/5] avcodec/proresenc_kostya: do not write into alpha reserved bitfields
  2024-01-07 18:16   ` [FFmpeg-devel] [PATCH 3/5] avcodec/proresenc_kostya: do not write into alpha reserved bitfields Clément Bœsch
@ 2024-01-08 20:10     ` Stefano Sabatini
  2024-01-08 20:33       ` Clément Bœsch
  0 siblings, 1 reply; 23+ messages in thread
From: Stefano Sabatini @ 2024-01-08 20:10 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Clément Bœsch

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 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 4 initial bits are reserved.
> ---
>  libavcodec/proresenc_kostya.c          | 2 +-
>  tests/ref/vsynth/vsynth1-prores_ks     | 2 +-
>  tests/ref/vsynth/vsynth2-prores_ks     | 2 +-
>  tests/ref/vsynth/vsynth3-prores_ks     | 2 +-
>  tests/ref/vsynth/vsynth_lena-prores_ks | 2 +-
>  5 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c
> index de63127192..f6c71c2b86 100644
> --- a/libavcodec/proresenc_kostya.c
> +++ b/libavcodec/proresenc_kostya.c
> @@ -1051,7 +1051,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
>      bytestream_put_byte  (&buf, pic->color_primaries);
>      bytestream_put_byte  (&buf, pic->color_trc);
>      bytestream_put_byte  (&buf, pic->colorspace);
> -    bytestream_put_byte  (&buf, 0x40 | (ctx->alpha_bits >> 3));
> +    bytestream_put_byte  (&buf, ctx->alpha_bits >> 3);

Shall be good, I wonder why it was done that way (probably there was
no open specification at the time?).
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [FFmpeg-devel] [PATCH 4/5] avcodec/proresenc_anatoliy: do not write into alpha reserved bitfields
  2024-01-07 18:16   ` [FFmpeg-devel] [PATCH 4/5] avcodec/proresenc_anatoliy: " Clément Bœsch
@ 2024-01-08 20:23     ` Stefano Sabatini
  2024-01-08 20:34       ` Clément Bœsch
  0 siblings, 1 reply; 23+ messages in thread
From: Stefano Sabatini @ 2024-01-08 20:23 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Clément Bœsch

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 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_anatoliy.c             | 10 +---------
>  tests/ref/vsynth/vsynth1-prores             |  2 +-
>  tests/ref/vsynth/vsynth1-prores_444         |  2 +-
>  tests/ref/vsynth/vsynth1-prores_444_int     |  2 +-
>  tests/ref/vsynth/vsynth1-prores_int         |  2 +-
>  tests/ref/vsynth/vsynth2-prores             |  2 +-
>  tests/ref/vsynth/vsynth2-prores_444         |  2 +-
>  tests/ref/vsynth/vsynth2-prores_444_int     |  2 +-
>  tests/ref/vsynth/vsynth2-prores_int         |  2 +-
>  tests/ref/vsynth/vsynth3-prores             |  2 +-
>  tests/ref/vsynth/vsynth3-prores_444         |  2 +-
>  tests/ref/vsynth/vsynth3-prores_444_int     |  2 +-
>  tests/ref/vsynth/vsynth3-prores_int         |  2 +-
>  tests/ref/vsynth/vsynth_lena-prores         |  2 +-
>  tests/ref/vsynth/vsynth_lena-prores_444     |  2 +-
>  tests/ref/vsynth/vsynth_lena-prores_444_int |  2 +-
>  tests/ref/vsynth/vsynth_lena-prores_int     |  2 +-
>  17 files changed, 17 insertions(+), 25 deletions(-)
> 
> diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
> index 2223721aa0..1112cb26f1 100644
> --- a/libavcodec/proresenc_anatoliy.c
> +++ b/libavcodec/proresenc_anatoliy.c
> @@ -794,15 +794,7 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
>                                        pict->color_trc, valid_trc, 0);
>      *buf++ = int_from_list_or_default(avctx, "frame colorspace",
>                                        pict->colorspace, valid_colorspace, 0);
> -    if (avctx->profile >= AV_PROFILE_PRORES_4444) {
> -        if (avctx->pix_fmt == AV_PIX_FMT_YUV444P10) {
> -            *buf++ = 0xA0;/* src b64a and no alpha */
> -        } else {
> -            *buf++ = 0xA2;/* src b64a and 16b alpha */
> -        }
> -    } else {
> -        *buf++ = 32;/* src v210 and no alpha */
> -    }

> +    *buf++ = ctx->need_alpha ? 0x2 /* 16-bit alpha */ : 0;

Is 8-bit alpha mode supported? (it doesn't seem from a quic look).
Should be good if not, thanks.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [FFmpeg-devel] [PATCH 3/5] avcodec/proresenc_kostya: do not write into alpha reserved bitfields
  2024-01-08 20:10     ` Stefano Sabatini
@ 2024-01-08 20:33       ` Clément Bœsch
  0 siblings, 0 replies; 23+ messages in thread
From: Clément Bœsch @ 2024-01-08 20:33 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

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 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 4 initial bits are reserved.
> > ---
> >  libavcodec/proresenc_kostya.c          | 2 +-
> >  tests/ref/vsynth/vsynth1-prores_ks     | 2 +-
> >  tests/ref/vsynth/vsynth2-prores_ks     | 2 +-
> >  tests/ref/vsynth/vsynth3-prores_ks     | 2 +-
> >  tests/ref/vsynth/vsynth_lena-prores_ks | 2 +-
> >  5 files changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c
> > index de63127192..f6c71c2b86 100644
> > --- a/libavcodec/proresenc_kostya.c
> > +++ b/libavcodec/proresenc_kostya.c
> > @@ -1051,7 +1051,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
> >      bytestream_put_byte  (&buf, pic->color_primaries);
> >      bytestream_put_byte  (&buf, pic->color_trc);
> >      bytestream_put_byte  (&buf, pic->colorspace);
> > -    bytestream_put_byte  (&buf, 0x40 | (ctx->alpha_bits >> 3));
> > +    bytestream_put_byte  (&buf, ctx->alpha_bits >> 3);
> 
> Shall be good, I wonder why it was done that way (probably there was
> no open specification at the time?).

The Apple encoder tends to write stuff in this reserved area. Currently on
the system I'm testing VideoToolBox is actually writing 0xE in the high
nibble (instead of 0x4 here). So far it doesn't seem to have any impact (I
tried to encode mov/prores files with and without alpha, with both ks and
aw encoder, after this patchset, and the files play just fine with
QuickTime).

I have no idea what impact it has internally as I was unable to locate the
encoder or the decoder in the Apple core frameworks.

-- 
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-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [FFmpeg-devel] [PATCH 4/5] avcodec/proresenc_anatoliy: do not write into alpha reserved bitfields
  2024-01-08 20:23     ` Stefano Sabatini
@ 2024-01-08 20:34       ` Clément Bœsch
  0 siblings, 0 replies; 23+ messages in thread
From: Clément Bœsch @ 2024-01-08 20:34 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

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 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_anatoliy.c             | 10 +---------
> >  tests/ref/vsynth/vsynth1-prores             |  2 +-
> >  tests/ref/vsynth/vsynth1-prores_444         |  2 +-
> >  tests/ref/vsynth/vsynth1-prores_444_int     |  2 +-
> >  tests/ref/vsynth/vsynth1-prores_int         |  2 +-
> >  tests/ref/vsynth/vsynth2-prores             |  2 +-
> >  tests/ref/vsynth/vsynth2-prores_444         |  2 +-
> >  tests/ref/vsynth/vsynth2-prores_444_int     |  2 +-
> >  tests/ref/vsynth/vsynth2-prores_int         |  2 +-
> >  tests/ref/vsynth/vsynth3-prores             |  2 +-
> >  tests/ref/vsynth/vsynth3-prores_444         |  2 +-
> >  tests/ref/vsynth/vsynth3-prores_444_int     |  2 +-
> >  tests/ref/vsynth/vsynth3-prores_int         |  2 +-
> >  tests/ref/vsynth/vsynth_lena-prores         |  2 +-
> >  tests/ref/vsynth/vsynth_lena-prores_444     |  2 +-
> >  tests/ref/vsynth/vsynth_lena-prores_444_int |  2 +-
> >  tests/ref/vsynth/vsynth_lena-prores_int     |  2 +-
> >  17 files changed, 17 insertions(+), 25 deletions(-)
> > 
> > diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
> > index 2223721aa0..1112cb26f1 100644
> > --- a/libavcodec/proresenc_anatoliy.c
> > +++ b/libavcodec/proresenc_anatoliy.c
> > @@ -794,15 +794,7 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
> >                                        pict->color_trc, valid_trc, 0);
> >      *buf++ = int_from_list_or_default(avctx, "frame colorspace",
> >                                        pict->colorspace, valid_colorspace, 0);
> > -    if (avctx->profile >= AV_PROFILE_PRORES_4444) {
> > -        if (avctx->pix_fmt == AV_PIX_FMT_YUV444P10) {
> > -            *buf++ = 0xA0;/* src b64a and no alpha */
> > -        } else {
> > -            *buf++ = 0xA2;/* src b64a and 16b alpha */
> > -        }
> > -    } else {
> > -        *buf++ = 32;/* src v210 and no alpha */
> > -    }
> 
> > +    *buf++ = ctx->need_alpha ? 0x2 /* 16-bit alpha */ : 0;
> 
> Is 8-bit alpha mode supported? (it doesn't seem from a quic look).
> Should be good if not, thanks.

Yeah it's unsupported; you can look into put_alpha_diff() where abits is
hardcoded to 16 (ks encoder supports both though)

-- 
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-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [FFmpeg-devel] [PATCH 5/5] avcodec/proresenc_anatoliy: do not write into chroma reserved bitfields
  2024-01-07 18:16   ` [FFmpeg-devel] [PATCH 5/5] avcodec/proresenc_anatoliy: do not write into chroma " Clément Bœsch
@ 2024-01-10 19:12     ` Clément Bœsch
  2024-01-10 21:43     ` Stefano Sabatini
  1 sibling, 0 replies; 23+ messages in thread
From: Clément Bœsch @ 2024-01-10 19:12 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

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-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [FFmpeg-devel] [PATCH 5/5] avcodec/proresenc_anatoliy: do not write into chroma reserved bitfields
  2024-01-07 18:16   ` [FFmpeg-devel] [PATCH 5/5] avcodec/proresenc_anatoliy: do not write into chroma " Clément Bœsch
  2024-01-10 19:12     ` Clément Bœsch
@ 2024-01-10 21:43     ` Stefano Sabatini
  2024-01-10 22:37       ` Clément Bœsch
  1 sibling, 1 reply; 23+ messages in thread
From: Stefano Sabatini @ 2024-01-10 21:43 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Clément Bœsch

On date Sunday 2024-01-07 19:16:47 +0100, Clément Bœsch wrote:
> 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: bff
>    3: reserved
> 
> 0x80 is what we expect for "422 not interlaced", and the extra 0x2 from

> 0x82 is actually writting into the reserved bits.

nit: writting typo

> ---
>  libavcodec/proresenc_anatoliy.c             | 2 +-
>  tests/ref/vsynth/vsynth1-prores             | 2 +-
>  tests/ref/vsynth/vsynth1-prores_444         | 2 +-
>  tests/ref/vsynth/vsynth1-prores_444_int     | 2 +-
>  tests/ref/vsynth/vsynth1-prores_int         | 2 +-
>  tests/ref/vsynth/vsynth2-prores             | 2 +-
>  tests/ref/vsynth/vsynth2-prores_444         | 2 +-
>  tests/ref/vsynth/vsynth2-prores_444_int     | 2 +-
>  tests/ref/vsynth/vsynth2-prores_int         | 2 +-
>  tests/ref/vsynth/vsynth3-prores             | 2 +-
>  tests/ref/vsynth/vsynth3-prores_444         | 2 +-
>  tests/ref/vsynth/vsynth3-prores_444_int     | 2 +-
>  tests/ref/vsynth/vsynth3-prores_int         | 2 +-
>  tests/ref/vsynth/vsynth_lena-prores         | 2 +-
>  tests/ref/vsynth/vsynth_lena-prores_444     | 2 +-
>  tests/ref/vsynth/vsynth_lena-prores_444_int | 2 +-
>  tests/ref/vsynth/vsynth_lena-prores_int     | 2 +-
>  17 files changed, 17 insertions(+), 17 deletions(-)
> 
> diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
> index 1112cb26f1..bee4a14181 100644
> --- a/libavcodec/proresenc_anatoliy.c
> +++ b/libavcodec/proresenc_anatoliy.c
> @@ -769,7 +769,7 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
>      bytestream_put_buffer(&buf, ctx->vendor, 4);
>      bytestream_put_be16(&buf, avctx->width);
>      bytestream_put_be16(&buf, avctx->height);
> -    frame_flags = 0x82; /* 422 not interlaced */
> +    frame_flags = 0x80; /* 422 not interlaced */

LGTM, thanks.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [FFmpeg-devel] [PATCH 5/5] avcodec/proresenc_anatoliy: do not write into chroma reserved bitfields
  2024-01-10 21:43     ` Stefano Sabatini
@ 2024-01-10 22:37       ` Clément Bœsch
  0 siblings, 0 replies; 23+ messages in thread
From: Clément Bœsch @ 2024-01-10 22:37 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

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 mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2024-01-10 22:38 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-11 19:06 [FFmpeg-devel] Misc ProRes frame header conformity fixes Clément Bœsch
2023-12-11 19:06 ` [FFmpeg-devel] [PATCH 1/5] avcodec/proresenc_anatoliy: use a compatible bitstream version Clément Bœsch
2023-12-11 19:06 ` [FFmpeg-devel] [PATCH 2/5] avcodec/proresenc_kostya: " Clément Bœsch
2023-12-11 19:06 ` [FFmpeg-devel] [PATCH 3/5] avcodec/proresenc_kostya: do not write into alpha reserved bitfields Clément Bœsch
2023-12-12 23:13   ` Michael Niedermayer
2023-12-12 23:16     ` Michael Niedermayer
2024-01-07 18:20       ` Clément Bœsch
2023-12-11 19:06 ` [FFmpeg-devel] [PATCH 4/5] avcodec/proresenc_anatoliy: " Clément Bœsch
2023-12-11 19:06 ` [FFmpeg-devel] [PATCH 5/5] avcodec/proresenc_anatoliy: do not write into chroma " Clément Bœsch
2024-01-07 18:16 ` [FFmpeg-devel] [PATCH 1/5] avcodec/proresenc_anatoliy: use a compatible bitstream version Clément Bœsch
2024-01-07 18:16   ` [FFmpeg-devel] [PATCH 2/5] avcodec/proresenc_kostya: " Clément Bœsch
2024-01-08 19:57     ` Stefano Sabatini
2024-01-07 18:16   ` [FFmpeg-devel] [PATCH 3/5] avcodec/proresenc_kostya: do not write into alpha reserved bitfields Clément Bœsch
2024-01-08 20:10     ` Stefano Sabatini
2024-01-08 20:33       ` Clément Bœsch
2024-01-07 18:16   ` [FFmpeg-devel] [PATCH 4/5] avcodec/proresenc_anatoliy: " Clément Bœsch
2024-01-08 20:23     ` Stefano Sabatini
2024-01-08 20:34       ` Clément Bœsch
2024-01-07 18:16   ` [FFmpeg-devel] [PATCH 5/5] avcodec/proresenc_anatoliy: do not write into chroma " Clément Bœsch
2024-01-10 19:12     ` Clément Bœsch
2024-01-10 21:43     ` Stefano Sabatini
2024-01-10 22:37       ` Clément Bœsch
2024-01-08 19:54   ` [FFmpeg-devel] [PATCH 1/5] avcodec/proresenc_anatoliy: use a compatible bitstream version Stefano Sabatini

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git