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 */