From patchwork Sat Aug 1 11:07:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 21414 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 467EA44B8AF for ; Sat, 1 Aug 2020 14:13:14 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2FB6568B8DE; Sat, 1 Aug 2020 14:13:14 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 41BEB68B8DE for ; Sat, 1 Aug 2020 14:13:07 +0300 (EEST) Received: by mail-ed1-f65.google.com with SMTP id o18so9636037eds.10 for ; Sat, 01 Aug 2020 04:13:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Hh/qa18+FFMpjCnVwkx37RXBE3nAvYZtqGa68Y+NnSY=; b=UGv2zQW7y/zSEJx+Jp6mQ0SiBCxljD7E1b1+w+qI8WKFSR7fc9vVCuXD9/nUeJGmfO sUYv2pRQb+x2N+mTzJluYTYTKXWv3kAcmTXfa41RndzKHiHqvaLz86vqDH5uzAYChuJB qyfFL/VlpZJEfkN+hH/Oa79CBGkUAXIyFBksX3wgq3t8OIKohsU1LHmcVBoXbK6jyxHv fgmJnTf7pRK+LUfO89B4bDAQFdllK/WmNSSN42jcVSL1T90aGV1d+iQcQoKu4ZhTxBrJ dkLOhI4uIx1o5ibFCe6CppxrY2DSVlJDqQ1/cmWWte3x9Btfop6qGzvsPv/BT3II+9af p+Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Hh/qa18+FFMpjCnVwkx37RXBE3nAvYZtqGa68Y+NnSY=; b=AfSsbIV2zbDLhil70H8ONs1ksDzSD7TQ3LMXSaTCoJsx9fawM+Tt73oW2cOsTe2swM 79w1h+/eZ2RalPn3Osl84RUdMDRjk9W1MrpWRsOaz9H527A7Cnp5172AURPp85dOGAdr 3veqhlnxgl7UMshaiuXcnLcS0eqbUqUdqBjvp32QQ1SC4nrbtX/8w7XhvgED4+N5L5m6 6n2TOnXmfKt1TcqJyZpaDmV0aCXWa2tCFTdt62I93QOTejfD0EEvqFknPEyMnEsbUX3I KI0j9gkmUhA7anvqRYJis+xb3++Vx+TbgCNBXTwYR2hVko7PKX8PzJ/0RLeEFzD/JTjC UTyw== X-Gm-Message-State: AOAM531m/KJS8ym9KAsRTcmRJatXlybBPF3UryjM132UZ5/6eO0bfIV4 DsQTjlnq6JlDLN4ViedPYG8B0T7v X-Google-Smtp-Source: ABdhPJwRfQ2b9QGxoT3Tw9mX520ECJ3hyrXyKwczuA/WBi22jTbfS0krbZ0lohPPuCkvr13LnRGx6w== X-Received: by 2002:a2e:810c:: with SMTP id d12mr3629024ljg.34.1596280056456; Sat, 01 Aug 2020 04:07:36 -0700 (PDT) Received: from localhost.localdomain (91-159-194-103.elisa-laajakaista.fi. [91.159.194.103]) by smtp.gmail.com with ESMTPSA id f24sm2694045ljc.99.2020.08.01.04.07.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Aug 2020 04:07:35 -0700 (PDT) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Sat, 1 Aug 2020 14:07:26 +0300 Message-Id: <20200801110730.30642-4-jeebjp@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200801110730.30642-1-jeebjp@gmail.com> References: <20200729113952.14574-1-jeebjp@gmail.com> <20200801110730.30642-1-jeebjp@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/7] swresample/rematrix: treat 22.2 as 5.1 (back) when mixing 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Only this sub-set of channels actually follows the bit mask order in the official 22.2 channel mapping. Additionally, the 5.1 channels are there for backwards compatibility with the previous system. This enables the utilization of 22.2 content until a proper down/up matrix is added into swresample. --- libswresample/rematrix.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libswresample/rematrix.c b/libswresample/rematrix.c index 983355ba36..d0c4a212b3 100644 --- a/libswresample/rematrix.c +++ b/libswresample/rematrix.c @@ -141,6 +141,16 @@ av_cold int swr_build_matrix(uint64_t in_ch_layout_param, uint64_t out_ch_layout ) in_ch_layout = AV_CH_LAYOUT_STEREO; + if (in_ch_layout == AV_CH_LAYOUT_22POINT2 && + out_ch_layout != AV_CH_LAYOUT_22POINT2) { + in_ch_layout = AV_CH_LAYOUT_5POINT1_BACK; + av_get_channel_layout_string(buf, sizeof(buf), -1, in_ch_layout); + av_log(log_context, AV_LOG_WARNING, + "Full-on remixing from 22.2 has not yet been implemented! " + "Processing the input as '%s'\n", + buf); + } + if(!sane_layout(in_ch_layout)){ av_get_channel_layout_string(buf, sizeof(buf), -1, in_ch_layout_param); av_log(log_context, AV_LOG_ERROR, "Input channel layout '%s' is not supported\n", buf);