From patchwork Sat Dec 10 15:33:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 39672 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp2329505pzb; Sat, 10 Dec 2022 07:33:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf5WH3nY1CqmqeuGzJnY/GzTFcnqArybdvMmsaSct+z1leALQmSS/NR6KRhQXyLemM8a8Pcb X-Received: by 2002:a05:6402:4501:b0:461:de81:d194 with SMTP id ez1-20020a056402450100b00461de81d194mr7906274edb.31.1670686418948; Sat, 10 Dec 2022 07:33:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670686418; cv=none; d=google.com; s=arc-20160816; b=dIGVx8WP/UVtZxlycy5xt6cfNuNKvBLVoUgp6uIb0J9Itv0Ty9ZABFPEJXANnYvPDt ZFjrAldsFR/Ic0QI3oz10eZWZRGnzwBKc2t58o7p2m7qOpNRdxWXQWRFYFDrd9ycRxtB RCCZYXqGjyWcqjE3YDy7FMcvKz5AmgvjjNkUKCx9omMD4CCWIsgYhPv5rAYclEAeOcMP HCQlRpF8ZBaAISKqRtkqy1odotOVPK5X7R7E/FJ+RUccq5JXJyLmtwykS4GpF2NZ7kw4 1hYM50AZnFNPAF1CxPfPo3K5tIa0KStKCn2D2dp/px1Pvk+sXL/W65JMMxKoP5VgQyJy gO6Q== 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:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=MP1KCXDcHllqijN1iHwNxqMIrRX9OSyD3XmL72xTiVI=; b=yUYq2AleJtWxEp3uDLOHreT/4BOcFWG8rvvQHUfFxUUGf25yc0zdCfZ2YuYWrDQb/x /uizmgVkbZyRyBfp2dgAkYOS9T6QgfjnHDgHVX0y6nTyfKdDzQDRmYpFfqRzlntr5Bot DfCcZlQ8jYfiyApBFqdR84XOoCAC7H4XTVYo0kmFl+mUKLVlvwCSNoEKlZYUoR6Oaw1x aE18JlDM4qD4/kZ6TZOsyNdnUER5Qbmf6Ck9oK4jIY53DwGx95YOIcZq9OHIBIldg2DI RgAFEPwwG4D/OEOq3S72Tg3ihIsVZhuPPR47ThxzzhY6kutrvaSR99s180lQtvy+QUfA e/WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=U2RUU6ng; 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 i14-20020a50fd0e000000b0046289aad428si3585209eds.496.2022.12.10.07.33.38; Sat, 10 Dec 2022 07:33:38 -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=@gmail.com header.s=20210112 header.b=U2RUU6ng; 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 BBD2C68BD0F; Sat, 10 Dec 2022 17:33:34 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 37B3068B461 for ; Sat, 10 Dec 2022 17:33:28 +0200 (EET) Received: by mail-ot1-f54.google.com with SMTP id m6-20020a9d7e86000000b0066ec505ae93so4614342otp.9 for ; Sat, 10 Dec 2022 07:33:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=pbP4XM/1feIYU0WN6aWa7Yu5wdtsfOIs7rkiuz1AInc=; b=U2RUU6ngPiqy75M5sbdSr8HAd55lnou0bgkiyK6rDx3t1wCcKv2ZIa+5wjkzFEtEtv Cn8AhxtQbfyMtruL6np5iic5yJcvCjo1OTJv/hgpzT3BDQsTw0gXml0OQYNpmyEnGMV5 seghxBUSTta5LQy+mwLB/7+yYlinGJVboc3fOpQcuod6ZbsyqmNuxhQBYBhyy4L4ibYM FtCriq3ktp7BYjqPP+LbcIrIKcdwut2htDWR98+xOZTWdAjZKf//v1WMppi6NHAo4A20 TFTS5WDBTzJKT30Rha3ETeKTn62MhS1g+GP7yp/lGIBVQ9KSbqM+nhJBxU+l9hlloAFj M9Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pbP4XM/1feIYU0WN6aWa7Yu5wdtsfOIs7rkiuz1AInc=; b=IrPyWoSAmIimhsoI0HPrL22dycTy7bacaGAhFVtuONI9nOFZjB0JFCSywvNJD21fBB UI3UnGAJ8OS+ULGA4PbQ8qMwcPs1D9t3H/ycomjvlV2C01iqHk8Gec+xypKvQYCPYZqE rUDiECxMCZ7ZVfphqS1N6y6OlrQozFPiAevBSUInTi1XBXFP0zj+SVRK+WVLCTCEdoGv XdjCvNxNASjrdKr99WSVxVn5HI786zybMHdZYsXjgG0Z0wKzNLLI9/oXC2m7KfxQKUL6 tmi7QUICFIjClq363oRbCJSh19M7sbFrA8Lv9DHfE9r99a7FlMMjtfm+ilh8J4gRLPPV eOig== X-Gm-Message-State: ANoB5pkEA1RQoKzmH7q6E7pLeoytd4lEMGNIfoNG9qehwWOaRUqdf6RS iJDZ7kBOdDf+v2gJPhukP7nbTThKeZg= X-Received: by 2002:a9d:4c04:0:b0:670:6518:ed17 with SMTP id l4-20020a9d4c04000000b006706518ed17mr4775404otf.32.1670686405871; Sat, 10 Dec 2022 07:33:25 -0800 (PST) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id t4-20020a9d7744000000b0067066250c57sm1941735otl.30.2022.12.10.07.33.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Dec 2022 07:33:25 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sat, 10 Dec 2022 12:33:19 -0300 Message-Id: <20221210153319.2831-1-jamrial@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avcodec/proresdec2: set color information on frames instead of the decoder context 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: aMVIh+YNCIHO Similar to how the encoder looks at frame color information to write the frame header bitstream. Should workaround ticket #10091, where container level color parameters passed to the decoder context were being overwritten. Signed-off-by: James Almer --- vf_scale should properly set output frame color fields to really fix this, since this information is in a per frame basis in the prores bitstream and as such making the encoder write encoder context fields into them would not be correct. libavcodec/proresdec2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c index b0d7f8d5d5..c821a07849 100644 --- a/libavcodec/proresdec2.c +++ b/libavcodec/proresdec2.c @@ -289,10 +289,10 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf, avctx->pix_fmt = ret; } - avctx->color_primaries = buf[14]; - avctx->color_trc = buf[15]; - avctx->colorspace = buf[16]; - avctx->color_range = AVCOL_RANGE_MPEG; + ctx->frame->color_primaries = buf[14]; + ctx->frame->color_trc = buf[15]; + ctx->frame->colorspace = buf[16]; + ctx->frame->color_range = AVCOL_RANGE_MPEG; ptr = buf + 20; flags = buf[19];