From patchwork Tue Jul 24 13:55:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Gorzel X-Patchwork-Id: 9783 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp6951929jad; Tue, 24 Jul 2018 06:57:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcc0wUW81a7hQHuWN/dY7qfSGgsohbCfPzgGUx+qEjQ8RxqkCx/3XRkIw4+WTniXL5d4tFF X-Received: by 2002:a5d:6601:: with SMTP id n1-v6mr5391731wru.281.1532440622809; Tue, 24 Jul 2018 06:57:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532440622; cv=none; d=google.com; s=arc-20160816; b=Moqud8yakVbRcbXQZHAJ+JG+lBkBRs213XiCeQP6d1MRKesRE+ULAoRFVu+nQPO6/J x/TxOe4YU3ihrhlSYDzRTyvMC4rYHkbOyd6IRBeBU2w3cv7SQuFaANlDx9UmZkAq4Ms0 3hwIKsDsZ2i0cMY5L2GIMGporPwJmLVFx8KI77owHeL1eGAMXjxO71SzFArxbS89f7Vd 8XP5O6+JXuZnsQzEl/jmkCWH/hFaJtrIbp23LtrNN13BGyqIo3d1HC/Oepl7qhPhc1ht NXwnDOgFEgN4Z+9Yl06/UdgbuBEX8WGQm9SnKvNw30abvODDUuf676T75k62vRo0IqKY ZFHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:to:from:references:message-id :in-reply-to:date:mime-version:dkim-signature:delivered-to :arc-authentication-results; bh=IAEPqqKFHvesTVOSsurvSgaUVCIRZ8V/NpqpnLO3DjA=; b=mpIXnFl89wJW4PRboLFYJ3GhRls9o2cAZpKaieiCqFm4u+1qF0EIOL8YSPUYMNd8IR UZuOWjLVsefY0OR+yNCTX+2C3eE6QN2I0Y//n/RNZRH877L8RfGUfJfv7j6vmaS0heAL 6UxIfR5RrKslPl2JDd3W0+yKzZc03k8xgmXWEBlRTa5AXio2qXXgS6h0skBown9D/btH KJeF/7exfUMaBPsUJsqEVic2bSquzBzqvUzWiO8FRTr3fR1zy8iAYZAEBkD1umnMz8rZ cDY0704R/URaD+e+QrUIsfyrEWHPBrBBMZ8UbsUe26OaO43fomh9dHvbZFHpdZ1BiSYO BO/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com header.s=20161025 header.b=IFj6PfUr; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id u2-v6si8756206wrp.39.2018.07.24.06.57.01; Tue, 24 Jul 2018 06:57:02 -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=@google.com header.s=20161025 header.b=IFj6PfUr; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7B5B068A37B; Tue, 24 Jul 2018 16:56:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-it0-f73.google.com (mail-it0-f73.google.com [209.85.214.73]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A0C2A68A1AD for ; Tue, 24 Jul 2018 16:56:38 +0300 (EEST) Received: by mail-it0-f73.google.com with SMTP id e21-v6so2554999itc.5 for ; Tue, 24 Jul 2018 06:56:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:date:in-reply-to:message-id:references:subject:from:to :cc:content-transfer-encoding; bh=n53OX8eE/6Yu3ESR31LKyzlk8DlQPi403nAeL8kE/rw=; b=IFj6PfUrXoMWwkqtLz0NyhSwsAJ3o1DgD+MlvWZH9iTrUUkidX8sHEeFNI34SDmGE9 lUHCKucE70E4ygCuEIhaqCf04Au+CEqSMp6N78FkE4zLzhpPxcUzu9yeSzf24eyebb5L 0JtCLS3PxKSa/QKktNeHg9B1U/q64NZuq3H3zRuZ6lPFHTHV5Cd6TSS0gTIpXgPuRlfB PItb5dCpiRChmMRcFNR8JWH+3PaweudSjFuHtACNfSmCRPaPlrsPdhggM/hf5y8Ljpub K9t/gOj2KsWFUqCfYaKNBaoaJHkkEzHZdO0D26Ms85s9TF0LKxJltj8/CwF5TQJOKwtB +vww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:in-reply-to:message-id :references:subject:from:to:cc:content-transfer-encoding; bh=n53OX8eE/6Yu3ESR31LKyzlk8DlQPi403nAeL8kE/rw=; b=PJmccFq+/W2jdPYhxDbAg5125EU0btBjjnWUie4fNHhUbKU/x+O05YdHTr4gqt1fYh I/dTFAjxICJu08LLdzQKtdz0N1nfgPifkt9pYhC/N1AfIEVjYiQcjUdgc8JoHcmTiHO0 AtjbIGGlT0gx+hbVAa8IhT76uUd8MUEmlALRseZFtXCc90/IRxhlNEpf3eTpw5toIuA4 rh745M1QA9rieJq7YwLL/C+H/ExJkR6YKidUHbQAK0q5QAfPXwId0i3FrniBhupHcYRd Bgb9EPiM+ELuzoJ22z9FuBMvsXpsN1wLoL+VGqgPg5Ypq0nSJZDXMcR8Rj8G5U6yzoYl 6/Fw== X-Gm-Message-State: AOUpUlH8tFaQ8kqnPuC7em0iM5OdNLrKfFpXFqfwDnrmrqnzMtno2ZHh lHI9FFPqhIRVNNk2a/vBe8mKoiF3vFQl+J912f+LaGpOAzDFNXH8dWI+vyuG3o5W2giCDoqrc/s xabYhYpoJ8SOS1DiaAFphk8zyXXWaFzrWkBr9aBJAWOqCmArDLsDcKOfBEyMCiBU= MIME-Version: 1.0 X-Received: by 2002:a6b:9245:: with SMTP id u66-v6mr6691100iod.11.1532440611063; Tue, 24 Jul 2018 06:56:51 -0700 (PDT) Date: Tue, 24 Jul 2018 14:55:47 +0100 In-Reply-To: Message-Id: <20180724135547.111499-1-gorzel@google.com> References: X-Mailer: git-send-email 2.18.0.233.g985f88cf7e-goog From: Marcin Gorzel To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH] swresample: Use channel count in rematrix initialization 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: Marcin Gorzel Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Rematrixing supports up to 64 channels. However, there is only a limited number of channel layouts defined. Since the in/out channel count is currently obtained from the channel layout, for undefined layouts (e.g. for 9, 10, 11 channels etc.) the rematrixing fails. This patch changes rematrix init methods to use in (used) and out channel count directly instead of computing it from channel layout. --- libswresample/rematrix.c | 4 ++-- libswresample/x86/rematrix_init.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libswresample/rematrix.c b/libswresample/rematrix.c index 8227730056..6b5feaa07b 100644 --- a/libswresample/rematrix.c +++ b/libswresample/rematrix.c @@ -384,8 +384,8 @@ av_cold static int auto_matrix(SwrContext *s) av_cold int swri_rematrix_init(SwrContext *s){ int i, j; - int nb_in = av_get_channel_layout_nb_channels(s->in_ch_layout); - int nb_out = av_get_channel_layout_nb_channels(s->out_ch_layout); + int nb_in = s->used_ch_count; + int nb_out = s->out.ch_count; s->mix_any_f = NULL; diff --git a/libswresample/x86/rematrix_init.c b/libswresample/x86/rematrix_init.c index d71b41a73e..d6616f83be 100644 --- a/libswresample/x86/rematrix_init.c +++ b/libswresample/x86/rematrix_init.c @@ -33,8 +33,8 @@ D(int16, sse2) av_cold int swri_rematrix_init_x86(struct SwrContext *s){ #if HAVE_X86ASM int mm_flags = av_get_cpu_flags(); - int nb_in = av_get_channel_layout_nb_channels(s->in_ch_layout); - int nb_out = av_get_channel_layout_nb_channels(s->out_ch_layout); + int nb_in = s->used_ch_count; + int nb_out = s->out.ch_count; int num = nb_in * nb_out; int i,j;