From patchwork Sun Jan 7 18:16:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgQsWTc2No?= X-Patchwork-Id: 45524 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:2449:b0:199:85ec:e0df with SMTP id t9csp614569pzc; Sun, 7 Jan 2024 10:17:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHyUgndFkjYQ9PeO7NiVeNoAUABgnOA2+eHRE6Ijj/VrCkGmLNbyMIrEiVFYnOy8dRIKxXY X-Received: by 2002:a2e:890d:0:b0:2cd:40a3:5d91 with SMTP id d13-20020a2e890d000000b002cd40a35d91mr941207lji.106.1704651449316; Sun, 07 Jan 2024 10:17:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704651449; cv=none; d=google.com; s=arc-20160816; b=VMo4e+jGNgHwNKM9CVTrLPrtuJGUQV8v7z2qJgNxfMVuZB0ZqVIbr4OZ9RUc1MD7fI YSdu1F+43UwkL/oy4l2HigUMfSiiOqIWsZHn3CpOVPfunLYTUh7h1wUbBseeuWSbWv5D 5xtI25d01sThkZAMpuGrzA5u0KvStw3GTAfHVHxkhP1PU/GpVpjgFqf0+vZtHIPaOuKA lZPd0XkiCCJHnQcoSy/V0ovj0mJldxI8/YM5NsFUQTY/a6vENmq27ZCUisH+DhP3gBcF 5Jt3Hg8Zm7Iuy4dff80gRhJ+PLdSDDT2wB6Zzqjq6rWqab3pTGWiEgbQy1gb+vCaW7/k BRqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=/aq0ZY9zVs1xs2I23m9QyegYxoQ+Oi4mDAu2uwhAnGQ=; fh=Jgo3TCyoG8OdFLqA8BuM7Wbf1w27210JU6p+E8x39/M=; b=tzCRhy4jxGh+r+pd70DbUgbMG/36R0I3GfiQy4jdoy5mgmjRJCeDCOgaXqbD1MEuqm CXRNBpLxrZ13uU7gkj3BXGbz5PIPVDj28gqTK5IB+8XHexsdXVXVJSgQkxlSAml4zTvh t0dr/pQg1ldeN0YuUdtAl6R/mIsTEFkE0tNlQ+Vc55EoH6+LkB7LoRRkwzXMbuz3wuTA FmzYQcjbOU+fAMdvGaybAydqgyPKrCTxW8A+6pDBJwRNIVovYYuKFi4gAaeCuE//uZYS mdJKLoWSkZpkPRs4N36HQGgiCSrVNHAiY8PDIGuLbhExu5WxAxR56ohVZDYxN8uZP41T iclw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@pkh.me header.s=selector1 header.b=CnxiqKnW; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=pkh.me Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g6-20020a50d5c6000000b00553e075a04esi2440166edj.201.2024.01.07.10.17.28; Sun, 07 Jan 2024 10:17:29 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@pkh.me header.s=selector1 header.b=CnxiqKnW; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=pkh.me Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9A2FF68CE06; Sun, 7 Jan 2024 20:17:06 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from ssq0.pkh.me (laubervilliers-656-1-228-164.w92-154.abo.wanadoo.fr [92.154.28.164]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4E9C468CDDD for ; Sun, 7 Jan 2024 20:17:00 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pkh.me; s=selector1; t=1704651410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yIY+jOmLoQZwkWGrfne8laUxNMYeSo3ewWWx7ojgqAI=; b=CnxiqKnWYPcfIX+mwD+2mENfhTFHC3IMo/8WuFyFyvEk3ZukAIPAqw6zUC8EfG0UDYruIh 2CO8EIEBmXts7LnpPbmp1Yd5Tkhs0fdEaZ8igZ4rBmgk5jLw/C+qAoF4/OLinoOtHFekMK I0MIfTYbY2eTB23zUxEKDLUjBtFfmG4= Received: from localhost (ssq0.pkh.me [local]) by ssq0.pkh.me (OpenSMTPD) with ESMTPA id 7cd6be0c; Sun, 7 Jan 2024 18:16:50 +0000 (UTC) From: =?utf-8?b?Q2zDqW1lbnQgQsWTc2No?= To: ffmpeg-devel@ffmpeg.org Date: Sun, 7 Jan 2024 19:16:46 +0100 Message-ID: <20240107181647.3049578-4-u@pkh.me> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240107181647.3049578-1-u@pkh.me> References: <20231211190908.1882569-1-u@pkh.me> <20240107181647.3049578-1-u@pkh.me> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/5] avcodec/proresenc_anatoliy: do not write into alpha reserved bitfields X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: =?utf-8?b?Q2zDqW1lbnQgQsWTc2No?= Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: rfZGMovRyj0m 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