From patchwork Mon Dec 11 19:06:51 2023 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: 45071 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1225:b0:181:818d:5e7f with SMTP id v37csp3137038pzf; Mon, 11 Dec 2023 11:09:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IFw0l5eHMaZOuY+Sqp5EDHCxvb5M9NzjWPYOC308g8Tof4Ssq7sAtQdQUctxq8cJK7N+Lh9 X-Received: by 2002:a17:907:d384:b0:a1c:897e:fd9b with SMTP id vh4-20020a170907d38400b00a1c897efd9bmr5808378ejc.6.1702321774599; Mon, 11 Dec 2023 11:09:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702321774; cv=none; d=google.com; s=arc-20160816; b=GMDg9Scmp1YFb0sEFxt/ygY0z7YHliX17h2iam8tZAvHtIWlVF6kLOFQCPyJZkMBx7 PeE7P6lTSqBw96GUlFeiV3bXb8HaYQItFexUo7upRm1baDms9fFzlGNUTtJeWVcqLDZ+ akjVNUe67xd6DCXP8m6pvVD/PxdqPqOAwZDFmG9WuNcqI+I/AthqLmGfv9a08ibzBxrH /BpHHhPJpLMgyxKfAdwzf8zV2qPqoJoRZC9Mj95BX1FD7Du7R2BGv5qWms+TxykVZA+Z UyYq6kQyhfGHqtOg26Ne5tDQBkJ0Hg7Wul6M+TDBneBXmJhdelG1NfbMbJTboYFjn9eg Xhaw== 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=iU21ZHr0yb3Mg6pPa60O/gvaEspiJ6/HlUUIqOa3N84=; fh=Jgo3TCyoG8OdFLqA8BuM7Wbf1w27210JU6p+E8x39/M=; b=SCifKxKu/6KHu5h96N4fQJnQbukon1SQltuCIUVAoUBK/hpna+ptD/g3PgMqdcP5Mw jaAFv9JqugS1WtLdvvijGeqk3GLAP5/yb7V8CrUhiypy5OPeDMwBKnzikCSnQLVCaETG 4eAMztgVsV+qo+OP2HBZlUpmqhYWvg820WucbdfeCvS+VM+ovuQC09+M6RTYcfyubYaS 4T8vjmksA5caHnAePFGQZXq5eqFymg9VSL4yi2M//AlGQVda3FOFaen2VTN8RsN+Qycy L6XPMMBQFbdXjbdAiEuXsI3oKBhSw8GRdcNgYxS0BxD/Wjeh9zE9+Q4SWwrsLUftxuOn CLIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@pkh.me header.s=selector1 header.b=CyPcEX5n; 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 lg9-20020a170906f88900b00a1ccba33273si3725729ejb.19.2023.12.11.11.09.33; Mon, 11 Dec 2023 11:09:34 -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=CyPcEX5n; 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 2656168D1DC; Mon, 11 Dec 2023 21:09:24 +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 E0A2C68D1DD for ; Mon, 11 Dec 2023 21:09:17 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pkh.me; s=selector1; t=1702321752; 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=KNV1qAezY5bboCw9dicHJUbzkjT23PC3DB9HjKwAMTo=; b=CyPcEX5nsA2nzhBqb3rWkMFeNACkxmeIWCzLi5Mrq7surTndMLsECPWNjvV1zNdEFhoQJA ivcMvw7jKTyX19z971MZ6Q5kQn+re2Ehwi6P/QiRLlDWLYC0WvKvtsmVj+bhRD6N4ac+p/ 6OjkSXbqlhIgCIFt+dCpNyr1If/MaJE= Received: from localhost (ssq0.pkh.me [local]) by ssq0.pkh.me (OpenSMTPD) with ESMTPA id 43ff3777; Mon, 11 Dec 2023 19:09:12 +0000 (UTC) From: =?utf-8?b?Q2zDqW1lbnQgQsWTc2No?= To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 Dec 2023 20:06:51 +0100 Message-ID: <20231211190908.1882569-2-u@pkh.me> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231211190908.1882569-1-u@pkh.me> References: <20231211190908.1882569-1-u@pkh.me> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/5] avcodec/proresenc_anatoliy: use a compatible bitstream version 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: LX8RxSwWx9cw 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); From patchwork Mon Dec 11 19:06:52 2023 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: 45072 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1225:b0:181:818d:5e7f with SMTP id v37csp3137141pzf; Mon, 11 Dec 2023 11:09:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IFBTLZhoeaGUKB1uJWI7tgRf8HJ2JH7ah9lAmQZweJnhAWl2+x5eKdNtawJ/RPIVVijaLa5 X-Received: by 2002:a17:906:d8db:b0:a19:a1ba:8cc2 with SMTP id re27-20020a170906d8db00b00a19a1ba8cc2mr1576070ejb.96.1702321783088; Mon, 11 Dec 2023 11:09:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702321783; cv=none; d=google.com; s=arc-20160816; b=cXyGp07m/Y5aa2K0VKtj0867aLxAqBMmGa7teXZG5tMYsPsBbavWJ8FJQ0gXdwztFC hHMuSEkRPxY5JcyaRkKDZd0RYjeXlxuadmug6tGKDUNZ6UstxuXudfo3H2izOxd613NY iZedqTVuwLwIjigvjwABa7vHey3sVU9XEA5JeXOSspTcZBoQsrpXGFzTDh9VrW21Qi9f Dhl9BQQY62LO4O3KP1EWHbEe2SjxwTXSspHYJYcIFC/uQQx0azPRhy4MNg9cV1UtCtKK iNffyLpKWU21gHZGyHxHjcTILwFP+lH8KNgDXGMpO1ToSCWEm8qo7VMsm4dNWA66/RV3 cTgg== 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=ZkwGlUUY+/QN/nW4KGfmyfE6Z+KQ6rmxNxkF+QO3o6k=; fh=Jgo3TCyoG8OdFLqA8BuM7Wbf1w27210JU6p+E8x39/M=; b=tLS2LXife1SbeAns1jG3KukJUdiIWf8y9qu8fEhiRWTBwiCW0ia8IpOXYawcCZzTa5 9vR9lbPr2xCK+EQM9wFldKjR9Wyc5b4JT6K02tnenwKiY6e1lCfpOYgHkFX1ufCuTDq6 0a9OJx8bA7qRCnaFdBApYjcumzmd97pgcv+zMKUQxUXkQ1xwWYzsLAiJ736ZbORBrfPO aG8SwsJ6YVUpR4o1rjtwziHoZWc1JWyki5WM3l2XheNkIvIAn69Y3E1y29x9A3tfavPW oR0HO4tpDnECmtq/yAcStA/6VRnnUyVgDhg/WfJwDAnyNZj65uG4PSVQOc55ny6DUlbf xYUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@pkh.me header.s=selector1 header.b="bd2VHMJ/"; 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 lw14-20020a170906bcce00b00a1d040c32b3si3764129ejb.653.2023.12.11.11.09.41; Mon, 11 Dec 2023 11:09:43 -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="bd2VHMJ/"; 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 3EDF568D1EC; Mon, 11 Dec 2023 21:09:25 +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 76C5F68D1D2 for ; Mon, 11 Dec 2023 21:09:18 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pkh.me; s=selector1; t=1702321752; 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=te4kAINmatea7tfsPx8pS4VO5UhE0u/EfDkxDEnaees=; b=bd2VHMJ/4fxG8EzWJTRg15sblaPMGsn7q9xOvcMEpSkidn+uGkYrmheX4G08CQz5/mAn56 waOqwBuUHycE1Bi8vyN1CFbXoJm/abOWr/yiWu/Wwq9dDBhZcJQSKPr4AoLcGbPleEhKU7 VYmQu7z47OSg4AVkpLLnKRWw+KDOGEc= Received: from localhost (ssq0.pkh.me [local]) by ssq0.pkh.me (OpenSMTPD) with ESMTPA id e54e3df5; Mon, 11 Dec 2023 19:09:12 +0000 (UTC) From: =?utf-8?b?Q2zDqW1lbnQgQsWTc2No?= To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 Dec 2023 20:06:52 +0100 Message-ID: <20231211190908.1882569-3-u@pkh.me> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231211190908.1882569-1-u@pkh.me> References: <20231211190908.1882569-1-u@pkh.me> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/5] avcodec/proresenc_kostya: use a compatible bitstream version 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: IVLnoESe1Dmn 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); From patchwork Mon Dec 11 19:06:53 2023 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: 45073 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1225:b0:181:818d:5e7f with SMTP id v37csp3137223pzf; Mon, 11 Dec 2023 11:09:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IE6/JJfB5b0bONoQKPfinNFz4078bhFm6P1VJICttHZGBQCC1nvunGBTY5v/31sUGBa0+Hz X-Received: by 2002:a50:cc8e:0:b0:54f:64f4:c2f1 with SMTP id q14-20020a50cc8e000000b0054f64f4c2f1mr6059296edi.2.1702321790651; Mon, 11 Dec 2023 11:09:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702321790; cv=none; d=google.com; s=arc-20160816; b=pUgUWanciYp7863AiYuzFlT+/hYBg7XxDmslh9DcfYPd6wj0A67SuA1LE8me1GO1lG 9BkPR2ngnFkaSMA3aZ/OSRSCxInLKzPbJe/IXUv18B29rQoZYTG8Z+Iv4wFlUeiSBhvU +EZjRJyLTuvm8f6IeNo00hSmSzUKviWFyHoNP3wIWBCcWWwQKX1za9q9t3LIsMcZl7Ak Fn7v/e+Ku0pCMypm+k+uB2Z35qDomqGHLQdPSYkIAEuWOA6nYrPIpIYGB6cAVJ9fjnbr Xeckgy4AvHutKFc8xC+5cgdeFxCIiKb6SQPlAP/jT0uSxipMneMssdZ4ctRky+a1UhxU eamQ== 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=UVMjpgw1ltPFZWOaMyLrwUZaajK2nviOhwvoWydjQEI=; fh=Jgo3TCyoG8OdFLqA8BuM7Wbf1w27210JU6p+E8x39/M=; b=TY/gI/7/jfn5rKV0E4iQJphuH9JWVWzHB1p4XW68HgeOSAGpliCUkNUKoPjbg06f4A Y5fJgN7nz1wSG2w9iMUhrRdO1J8vT6qlSvjzzUg56FVaVx2gZI3ZrGrSKiJpASIruThy t4tjLu0T/jqf+fxPXOrv2UUyHmMFF6lQU0dbwTMELFfAa9dcCzGJIqjeQXrq/p8ZvYsZ Zk5e9+FJd1mz1vlgFJYhixfkYiNNE81GUkxC0P1a6nZBrri9Sm34Z20S8psKGYnfbC7J QwOSEKmBWZLXYE7nD2+wo8jvGFZXJRqWMv1BGNc4l1xs5tkPyZ0UYERV1CMNRsQP+pId TiCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@pkh.me header.s=selector1 header.b=jBB5mVZs; 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 g8-20020a056402090800b0055134663ad3si916717edz.149.2023.12.11.11.09.50; Mon, 11 Dec 2023 11:09:50 -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=jBB5mVZs; 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 73CA568D1F7; Mon, 11 Dec 2023 21:09:29 +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 E17C368D1E9 for ; Mon, 11 Dec 2023 21:09:22 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pkh.me; s=selector1; t=1702321752; 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=rGEJuWuLQ7D7ENpvq+bp0m6crgOLBGyOLX83TnzazMM=; b=jBB5mVZs71Iln2z3cErWU9YdH3huKtJ7hpcodyrcRgGxxPi7KFw93mZmAYZm1iXVldsWi8 vjZZfwy6VUXsHgQ2hDyjbgPZOi8bjSRKt8+Dw+XRXliBTF28RnmLnQ9dkw/nDjjUCxhevq hm5wfcXuTS1ohN/+UnPFn+Us9MuMk/8= Received: from localhost (ssq0.pkh.me [local]) by ssq0.pkh.me (OpenSMTPD) with ESMTPA id 43d9a4c0; Mon, 11 Dec 2023 19:09:12 +0000 (UTC) From: =?utf-8?b?Q2zDqW1lbnQgQsWTc2No?= To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 Dec 2023 20:06:53 +0100 Message-ID: <20231211190908.1882569-4-u@pkh.me> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231211190908.1882569-1-u@pkh.me> References: <20231211190908.1882569-1-u@pkh.me> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/5] avcodec/proresenc_kostya: 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: pfgZ8UkjEm/M 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 From patchwork Mon Dec 11 19:06:54 2023 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: 45074 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1225:b0:181:818d:5e7f with SMTP id v37csp3137292pzf; Mon, 11 Dec 2023 11:09:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IEA/k5OyVa/6I3HMSX9YcbJuYAPXnEmpgb/C38MpnnTZvT14wJAOkoVv8O9bmGLgKyAmR/P X-Received: by 2002:a17:906:74cf:b0:a1a:7568:1d4d with SMTP id z15-20020a17090674cf00b00a1a75681d4dmr2815694ejl.27.1702321799239; Mon, 11 Dec 2023 11:09:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702321799; cv=none; d=google.com; s=arc-20160816; b=WqEWNc5L7z29EF5cqYQzoJ4DkoDxybpesswsnP1kLzdtjxA+wt7POH+GPxfHGU3YMF GhZRjC4yTj45KS6637vto4tAwkDnBixqnikznGF0ItQGu3520gG7h8YImO+IszxPo0nI wO9NQHTxVlzO+Nnmium/2tqXRMbMM2/Y993KM7CNpssMlHwqvgCyWu7UAdymbKA37RHW yHq8Gz+saN9XlpQj7Kt+RtalQ+UPPzlYWUO+1cU2jdb6YvEC2Km85E0MmFgFkNFSCOhl qJZnC0aXURtYFlL3wBb13wNjifgWGzP96N9zyOMCrHYxODTF4wC8x9AJpluuoTW+nfIv AGjw== 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=7k2LYoKTD8aAen7a3cys8yexhbvuQMKSzUuEkNja/64=; fh=Jgo3TCyoG8OdFLqA8BuM7Wbf1w27210JU6p+E8x39/M=; b=jrI6mkFp89SteVxv4ws2sI9xDNFN5eGiWr17g8njnqobiQX2/NkEiRgnBcYAh3OHvl 5N23heUR/iq+D03mbkEqgLkCMXn4BehFZKX7S44x+UoTEtBWbjUUf86bRXh+EcvChmZr 1Gny/p+EcqpSl/m1uHcAuBHafCIu27adNS4f6rijr77F5gV/dj7IOD+WFLcN2V3jsrm9 nv1sTrAb4vD8ujylW+FT7VH7/KQ7gZFtV5ma1ekRyNVahV7RdpoGdidHepN3M3X1nFPZ x3djl+zyC4mg8UCCIzLpwl/zIQjq1k7bhauxbfTTERMXNW9fusZOLn0z4i9QtZlTy0Ch PH4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@pkh.me header.s=selector1 header.b=VoIhOrj+; 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 c15-20020a170906694f00b00a17ca6a4fbesi3879508ejs.534.2023.12.11.11.09.58; Mon, 11 Dec 2023 11:09:59 -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=VoIhOrj+; 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 691E468D1FD; Mon, 11 Dec 2023 21:09:30 +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 1AB2368D1EE for ; Mon, 11 Dec 2023 21:09:23 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pkh.me; s=selector1; t=1702321752; 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=Y0cGrDh3Z/hliOvmE06VoBTG/i5GKSRN6w+qL+cztcU=; b=VoIhOrj+Rj9yXNXD6fJbOBuxOoH1t7pu1aB7HfrCc6z4wu5XxYHOnY+Ymxx8tFTZSvQ/zs 5kkCd5L4mzhlBikSzeivC6Xe3XUnZToLUjyyp6kxvpy9/DmbwWLVy1ZcTVb8Va6GMQxsDz H4jZPLWU4HUYVasvjDmY0Jfzn82U+yM= Received: from localhost (ssq0.pkh.me [local]) by ssq0.pkh.me (OpenSMTPD) with ESMTPA id 909cf185; Mon, 11 Dec 2023 19:09:12 +0000 (UTC) From: =?utf-8?b?Q2zDqW1lbnQgQsWTc2No?= To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 Dec 2023 20:06:54 +0100 Message-ID: <20231211190908.1882569-5-u@pkh.me> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231211190908.1882569-1-u@pkh.me> References: <20231211190908.1882569-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: lCrZipcMIYsY 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 */ From patchwork Mon Dec 11 19:06:55 2023 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: 45075 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1225:b0:181:818d:5e7f with SMTP id v37csp3137384pzf; Mon, 11 Dec 2023 11:10:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IHLd8g0pK6vhXv81LJTpl0yzCm00wfkxS3T99se1b2uN/qL+VJeCcxwBpul++cLzsswLAQ8 X-Received: by 2002:a17:906:5a49:b0:9e0:4910:166a with SMTP id my9-20020a1709065a4900b009e04910166amr2803093ejc.32.1702321808072; Mon, 11 Dec 2023 11:10:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702321808; cv=none; d=google.com; s=arc-20160816; b=YfyQGszduqrPIsyPT17dkbTcCgg2V88oBAbzLHU1HIMUa1AiOUlaMEhrJrb03V60KW eL4061SwpgCKbBeTNx9GmUy/dKgKMV617P14pA0IAXvT1G0fu2juisq7OXU4FGUSnT1O BJZ94nJCK8O9hlSVUhgbffC9BtuoChKi0w67V7mhTrgJXdh2/5KfUF+tqOsqWWFDFi/x yzkkbYbg5UBACbTazVenHMRKaDJwRALOgB9uOh2Ru88SnOR9642FxUhfaqp7xKjtWdFl ndB6UPDBsEUs1j2/nmgnXpJECUCH3jkm6qHvsmrPmdejhlHweAcSbOKpYqRreP3BPP02 /q6A== 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=8WU9ujyCR0tDNoNf6F4HyKG7HN2RDqh+csxp5pCF4x0=; fh=Jgo3TCyoG8OdFLqA8BuM7Wbf1w27210JU6p+E8x39/M=; b=g3f70Oa9BZbQh8p9TVxkj9WsdDWUdM1UAVRCpWvZ43X6oJAN8jfXy2JWY5Vd7ApmXG czDM2O1+lTInyoafAwV/yHxYI19ybLxUDZc9ra26f7pAg0/yRbOXHyjfQwU+2CQ0M6Im zLkJ2LVEkOd6jBeJvS3IFVVg0CyLyfmPTcVbKk5qAffvcA0UlHhzA9W+/RIjxHFqWblG BX8MrIb8tXq4IZsEX+iYlUgtN1yZY4saSnGlPSxTRZn8oD03bLX+2iXnBwLwf4fp+Urj 9jvJdgwS6tya4nD/o3TAp1/UtuW406uuNYG5FBfgvgN5148E2Al0Hirq89Mmn8z7TAr6 4mUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@pkh.me header.s=selector1 header.b=cKURna6k; 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 ha13-20020a170906a88d00b00a1d5063b018si3866873ejb.718.2023.12.11.11.10.07; Mon, 11 Dec 2023 11:10:08 -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=cKURna6k; 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 4582E68D204; Mon, 11 Dec 2023 21:09:31 +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 A707068D1E9 for ; Mon, 11 Dec 2023 21:09:23 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pkh.me; s=selector1; t=1702321752; 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=fvyHtgc2OiK+Wu3MwP+ZEA21yvYp0n5pSj0e0J6NVrg=; b=cKURna6k5C3OTKyYJwSV9n0peMi+PlloHFIaibntG2QGzxzOLlLaQ4dVPT8GY2QaHYTEn7 xhiSrztkIkpPfgrWnlcZfiSNIeWK+PcoZiqTiqscUb/gfnGUqeNRW6qgpixmsH5jpTrU1B 5ghNNOHVOKBAHdr84DHnpbyHYA6w2Hs= Received: from localhost (ssq0.pkh.me [local]) by ssq0.pkh.me (OpenSMTPD) with ESMTPA id c3e39c6e; Mon, 11 Dec 2023 19:09:12 +0000 (UTC) From: =?utf-8?b?Q2zDqW1lbnQgQsWTc2No?= To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 Dec 2023 20:06:55 +0100 Message-ID: <20231211190908.1882569-6-u@pkh.me> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231211190908.1882569-1-u@pkh.me> References: <20231211190908.1882569-1-u@pkh.me> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/5] avcodec/proresenc_anatoliy: do not write into chroma 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: BE9XFqZF70LK 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) {