From patchwork Thu Sep 17 00:14:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Koshevoy X-Patchwork-Id: 22451 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 4CB2144B358 for ; Thu, 17 Sep 2020 03:14:41 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2ECBA68BACE; Thu, 17 Sep 2020 03:14:41 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3B7D768BAA4 for ; Thu, 17 Sep 2020 03:14:34 +0300 (EEST) Received: by mail-pj1-f53.google.com with SMTP id fa1so325762pjb.0 for ; Wed, 16 Sep 2020 17:14:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PdmMEkSs/Zd+T6DnjGJ6MSYEMTJluf0GMmAOY2SdcVc=; b=DioENrIDB1u3MPTbbKKeubEgY1UBU+54UHDms+0HFK2TjRqJYhebA1ZwzzQ+jzhN/V 2y9ehEvnNidmq5PH4dTzvo07xZjMB9LQliZ72az78XbQGvT5e5Td6j9w0QyNMBKdrI4U wjwAN/4nu7QID71dHbdHFf6o030VgXs8P6tbfhEQe4MA8cih0Rfv9Yb/80nS1zJ7mxic sA3sfSMlXNc2rI8K+fo7G+NK+9ZDV79XgZ5l8Ctc9sjzfeCKZN2p2qX+oUYuGzeR/7/z sYQC6BZ8Rabge8R99W/dnoZ0WVAOvauY+rZ5+1V+6H2AAoiGRazIbD/NDhRJxfNNK7ue QsEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PdmMEkSs/Zd+T6DnjGJ6MSYEMTJluf0GMmAOY2SdcVc=; b=cJlrRO/QW2dZSjuZfu+o+mKOziJR44duREbP8Ah9ZNisKY/DCL056fTH/0rmV5xZNU 0Y0BMm8HuTs/N1HszdQSnIgk1bHMFki3LabvbAQLPjZNNioujQZ8E1whG7Y/VQ85qC3O +RStn+nqAwjuJW8D/dZG900PGhvNjaC5FqJAs+jRHYEv01bhdv2c0LHMq2SOpypwQpqP 5yvzlrqO9w4E6OamIwJxIthJVVHHBBUZikX1xKL6LkabzF/QZst4UpRxp5BU9kiwbYjN lg+3fkU4C0NjvsXFi/VPI+rvvDiUzmtn+PF9tkOeszbfLvxdCMlaMu4hcevo6/skoNgO p/mQ== X-Gm-Message-State: AOAM530U8cpAGHzJ1b+zK3osz4fgEwMj00iNoPcWj4HtT7ena8BH8WcM ah+9no5Z/bQgHIupYS+fsBMoE0BxzsX5ng== X-Google-Smtp-Source: ABdhPJxPZ0DxQq3wjeZtK6rTv/6RbaefEUzKxiQybePtOprzQjljguomzDVgRgiHuV402Tv/EyFUqA== X-Received: by 2002:a17:902:7594:b029:d1:e626:ef9e with SMTP id j20-20020a1709027594b02900d1e626ef9emr8330731pll.67.1600301671938; Wed, 16 Sep 2020 17:14:31 -0700 (PDT) Received: from homestead.aragog.com ([2605:a601:a9ae:9100:b62e:99ff:fe37:7032]) by smtp.gmail.com with ESMTPSA id a5sm3777951pjd.57.2020.09.16.17.14.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 17:14:30 -0700 (PDT) From: Pavel Koshevoy To: ffmpeg-devel@ffmpeg.org Date: Wed, 16 Sep 2020 18:14:29 -0600 Message-Id: <20200917001429.20867-1-pkoshevoy@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avcodec/hevcdec: fix per-frame signaling of color_trc X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: Pavel Koshevoy Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This is a partial revert of f2ad6238e4c0e99e2fc131ee14c586e87b045680 It fixes per-frame color_trc signaling of arib-std-b67 frames. Reproducible with: ffprobe -show_frames lg_4k_hlg.ts | grep color_transfer= --- libavcodec/hevcdec.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index c1de75abe1..e3d1e3f693 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -2810,6 +2810,12 @@ static int set_side_data(HEVCContext *s) s->avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS; } + if (s->sei.alternative_transfer.present && + av_color_transfer_name(s->sei.alternative_transfer.preferred_transfer_characteristics) && + s->sei.alternative_transfer.preferred_transfer_characteristics != AVCOL_TRC_UNSPECIFIED) { + s->avctx->color_trc = out->color_trc = s->sei.alternative_transfer.preferred_transfer_characteristics; + } + for (int i = 0; i < s->sei.unregistered.nb_buf_ref; i++) { HEVCSEIUnregistered *unreg = &s->sei.unregistered;