From patchwork Mon May 9 18:16:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aman Karmani X-Patchwork-Id: 35704 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:a885:b0:7f:4be2:bd17 with SMTP id ca5csp3038300pzb; Mon, 9 May 2022 11:17:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxzpRPFPWNJt2YOJK5Nnsg/fghNosK3c2cE3Mm9cC+zWIXe7O0veza9n3Mqf6qgILv1qXz X-Received: by 2002:a05:6402:40cf:b0:427:cead:dca with SMTP id z15-20020a05640240cf00b00427cead0dcamr18982199edb.380.1652120227683; Mon, 09 May 2022 11:17:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652120227; cv=none; d=google.com; s=arc-20160816; b=Zo+hPNb3x7KpQNi3+aN+NhSo/s3+9rsqG3yoJ1qOPN2Dao3ixRQtkeY8p6dH6zirr5 xTur905Vkz9OiCa/rAbXmX7WznoiRz2vmJYNln2g02q9nKAIBhvUVekxtX5OVQi89p/n zOTsnlwMGF4aIKlLNg+QXMvY7tzD6Jdzip9kSzyxGSZ/k3Qo8vxruq05WP4AF4HCPgXl LmT9U3ZcAgo7Ohip/wrMLHLgK0vjQRnY9sywXXm6ghAtgZm4xzKrnyp5kkcgGiWhGnKE zmv0m1jYSyxrJWh+hSfjDqiDYxdwgrmPWKqnvw1VPHheDADzCMYz69lVKGpy0YNAtW7L l3qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:to:mime-version:fcc:date:references:in-reply-to :message-id:from:dkim-signature:delivered-to; bh=YA9/Wc3Tqz8UFfuH3KVdoY+ShXIBLMbvkEr5bE0AHj8=; b=BarTERelnTEb8qGk8ZwNqyA9zL7E2l6BPvDQw89TZQLQEGPu+qj1lJqrijLdoirXpL 5RWWAG6U9iVeBSTFd9xeLItU5xVNEeiMn4pK9Odwvff+lcnqmepma20weNIRt+lTf9EU KbnRxt/1LZ1gTQmqF0O3tDJ5largs9AVG9klPWt8jGgtAIj46AGj2paQsCyTn1at7P17 zqikELDw4+iMkBJZ85oWyxjJyOF/fqX5RjsyYBSEJJ+w9Z6aXd69ZieVibmj7Poktrh2 +f7Odnp39peH1Ba/N8Z9/1qVIbVjAxLcijcm/Ti5tfaZANmndEHuwOL6/KOmYf+6hQbV K+hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=VeP3yA4y; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id n18-20020a509352000000b0041d2e4dab4esi12840080eda.364.2022.05.09.11.17.07; Mon, 09 May 2022 11:17:07 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b=VeP3yA4y; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BB0B668B3D6; Mon, 9 May 2022 21:16:37 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DA5EB68B3B5 for ; Mon, 9 May 2022 21:16:30 +0300 (EEST) Received: by mail-pj1-f47.google.com with SMTP id w17-20020a17090a529100b001db302efed6so80923pjh.4 for ; Mon, 09 May 2022 11:16:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:message-id:in-reply-to:references:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=GiZorwrGZUuPYMY6/dPT4PrYEpzjb5GHHkMZFkSlAus=; b=VeP3yA4yPCcARf/qJsImtO/vNiMi+m3yenmTrzhdn3JcD8rafUcenlc3aBCu+qQdSI W4c70WrW2k8RhD9glL1VuFQRZcuJCRvORUeVJGs9wK79PP+X/+iGuWqzXFqywBv817qF u0csRchfBMeq1CQpjYWZD3rt5F+83ryIfR3UXpSeUGLf/dGi4kDeuCe9cfqDTAhVFWp4 OLzRGRreI6dSvZDLney4+GjdN7gpzuWKZJThiKMxYqV/WhwfAdPv5CGZf0LaC3yjIxHD u1/9PuMbZY1WwGhxmv9HziJG0be1mzqLshMtFJQ5TPTB48PSmmU0rSq1OLBSOGIQ8ZC9 oaYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:in-reply-to:references:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=GiZorwrGZUuPYMY6/dPT4PrYEpzjb5GHHkMZFkSlAus=; b=78gt+ZpbgG+hkMnG/S0dQ6rB2bxa15KlzBsTxc/0svKjdjGMA4lazGgWB/aEoV3BuI NfjW0fOTKxT7xBoIzh1qPuB+2b50PIerca1qIopfD+8MUyO6+mcznt7oBzPTEBoS13Xa +CQJ2/k6TdSnZ9atTTERJyBtCxISmpsimnFU8oEvOllrolJloGt3bzsKx1GMGsWaJwlp 4kI+I0YGfxue9GRTEjXUBe1b5VVNvzwmm4HVkhIRAVWTd0RQl8xhl1ahT2EW12ot7Dnu MRPtZEJcyaR80ZJOQhrglavtaiuUvtPTApbN2VYpEZ1V+4Dx7Yj8hI6aSrJsQ32J+tWC aGZA== X-Gm-Message-State: AOAM532oHjp0pS41rl9fPH6ZkZGi+Wq7lYcYp75L9m7P4XQdgU7UpKMz P4Q00O3gcs88hnjzwixOLN+Gfow/qo9ZFw== X-Received: by 2002:a17:90b:1b0d:b0:1dc:672e:c8c2 with SMTP id nu13-20020a17090b1b0d00b001dc672ec8c2mr19325362pjb.96.1652120189199; Mon, 09 May 2022 11:16:29 -0700 (PDT) Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50]) by smtp.gmail.com with ESMTPSA id 13-20020a170902e9cd00b0015e8d4eb22fsm177510plk.121.2022.05.09.11.16.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 May 2022 11:16:28 -0700 (PDT) From: rcombs X-Google-Original-From: rcombs Message-Id: In-Reply-To: References: Date: Mon, 09 May 2022 18:16:21 +0000 Fcc: Sent MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH 3/6] lavc/videotoolboxdec: fix generating HEVC general_profile_compatibility_flags 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: xwQjY1gMEpg4 From: rcombs We store this as an array of bools, not a bitfield. Signed-off-by: rcombs --- libavcodec/videotoolbox.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c index a1933f03f2..c95c53fcf0 100644 --- a/libavcodec/videotoolbox.c +++ b/libavcodec/videotoolbox.c @@ -273,7 +273,16 @@ CFDataRef ff_videotoolbox_hvcc_extradata_create(AVCodecContext *avctx) ptlc.profile_idc); /* unsigned int(32) general_profile_compatibility_flags; */ - memcpy(p + 2, ptlc.profile_compatibility_flag, 4); + for (i = 0; i < 4; i++) { + AV_W8(p + 2 + i, ptlc.profile_compatibility_flag[i * 8] << 7 | + ptlc.profile_compatibility_flag[i * 8 + 1] << 6 | + ptlc.profile_compatibility_flag[i * 8 + 2] << 5 | + ptlc.profile_compatibility_flag[i * 8 + 3] << 4 | + ptlc.profile_compatibility_flag[i * 8 + 4] << 3 | + ptlc.profile_compatibility_flag[i * 8 + 5] << 2 | + ptlc.profile_compatibility_flag[i * 8 + 6] << 1 | + ptlc.profile_compatibility_flag[i * 8 + 7]); + } /* unsigned int(48) general_constraint_indicator_flags; */ AV_W8(p + 6, ptlc.progressive_source_flag << 7 |