From patchwork Sat Jul 6 13:59:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 13832 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 1E831448C2A for ; Sat, 6 Jul 2019 17:06:12 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F354268ACBC; Sat, 6 Jul 2019 17:06:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EC47468AB33 for ; Sat, 6 Jul 2019 17:06:05 +0300 (EEST) Received: by mail-wr1-f47.google.com with SMTP id c2so12525883wrm.8 for ; Sat, 06 Jul 2019 07:06:05 -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=8SAgNTsoNTbvTyYFZ3dJmZwEwa+HHAf5Zjp5jfRYHuM=; b=f9QnkHurglCGspHOIvlbZe389TH7a8YTEhCXxYclMPm3oONFamlRHMz73Vs1/IwXU3 I5nUHrPSDAVZ8Lhiz9Ae98Jr9612hppMo9ejO6fPN89mgEg5utPkSzvkGjel/7sSpLRL Sn0thcW8+Yl3LNfIfbTcMQrxVhfm9NhcViNKk0yctz2v+y4HOw7oGuoeYVa89ZBlQQW3 ePxLWMLCGmJoxFOCSDJsXtJ6TA6Ob6FGbuU1tLidJUn7Jzhml01k7VcERzoAh0ahN83Z xW1qcJkzFXnzUlcrid6EaNQnfeCLqLmA93oCLGCAnRSO7SYOp5NpovK/KSu3EsJG0JyD bAPg== 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=8SAgNTsoNTbvTyYFZ3dJmZwEwa+HHAf5Zjp5jfRYHuM=; b=tNIOGJI9SuxLPt73hs2dRzXfln64X0b18okIIK4megRUHpFPjPIg0Vj3CDuoTBa8dd MlY3WCYQWzPbr9V+UKdPvrBKFK33gGB/6fAe3sOwmgXS92gJXLdcmlagKBlVvpkK1jzo MSh2hSRGlKG0UNTh6HtWv7jDmXN83EIXGOq6XiF0jPDWes0CdoPYSLeH4zNUpC3OZ1U4 cSfTXwIxtzQmI4y4lctURUwv716RuyCfiJgY3ETI4z1jXxiPfgxdCdhhk13tb1xLj/v1 WCRizfdkTdWZcNxmXnO1UgFhUFPdSx9d1+fjkvyKxELaeZ2DGI6r9F9WXG9aQ1fCon9F 8fxQ== X-Gm-Message-State: APjAAAX3wq7XOb3kYAQA8c4P+EOkIA1/vgpXX1Dr7uInOCu164/hQw/S zcu5O+WRZsZVfkzzxc0XHP3KpUMz X-Google-Smtp-Source: APXvYqxskNVoa9KYlTpgMA0y9mtA/OMJzuBqJ6tjBF3OFDLbw4RvaRHdI1LK8foxPO5fpUpCOpEfyA== X-Received: by 2002:adf:df10:: with SMTP id y16mr9504861wrl.302.1562421570079; Sat, 06 Jul 2019 06:59:30 -0700 (PDT) Received: from localhost.localdomain (ipbcc08b8f.dynamic.kabel-deutschland.de. [188.192.139.143]) by smtp.gmail.com with ESMTPSA id a64sm16083784wmf.1.2019.07.06.06.59.28 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 06 Jul 2019 06:59:29 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 6 Jul 2019 15:59:06 +0200 Message-Id: <20190706135911.11986-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/6] truehd_core: Disable 16-channel presentation 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The most serious bit of the substream_info header field (in a mayor sync packet) indicates whether a 16-channel presentation is present in the bitstream. If set, the extended_substream_info header field contains information about the 16-channel presentation. This presentation always uses substream 3, a substream that is discarded by truehd_core. So substream_info needs to be changed to no longer indicate the presence of a 16-channel presentation in order for truehd_core's output to be consistent. This is implemented in this commit. This change also makes MediaInfo no longer display the presence of Atmos in the output of truehd_core. Also, set the (now irrelevant) extended_substream_info field to zero as this seems to be the common value for ordinary TrueHD. Signed-off-by: Andreas Rheinhardt --- The info this patchset relies on can be found in Dolby's TrueHD (MLP) high-level bitstream description [1]. See sections 4.2.8 and 4.2.9 for this commit. Thanks to Hendrik Leppkes for the link. [1]: https://developer.dolby.com/globalassets/technology/dolby-truehd/dolbytruehdhighlevelbitstreamdescription.pdf libavcodec/truehd_core_bsf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/truehd_core_bsf.c b/libavcodec/truehd_core_bsf.c index 9e3ee07eed..757d26a10d 100644 --- a/libavcodec/truehd_core_bsf.c +++ b/libavcodec/truehd_core_bsf.c @@ -121,7 +121,8 @@ static int truehd_core_filter(AVBSFContext *ctx, AVPacket *out) AV_WN64(out->data + out_size - 8, 0); if (have_header) { memcpy(out->data + 4, in->data + 4, 28); - out->data[16 + 4] = (out->data[16 + 4] & 0x0f) | (FFMIN(s->hdr.num_substreams, 3) << 4); + out->data[16 + 4] = (out->data[16 + 4] & 0x0c) | (FFMIN(s->hdr.num_substreams, 3) << 4); + out->data[17 + 4]&= 0x7f; out->data[25 + 4] = out->data[25 + 4] & 0xfe; out->data[26 + 4] = 0xff; out->data[27 + 4] = 0xff;