From patchwork Sat Jul 21 18:31:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Gorzel X-Patchwork-Id: 9773 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp4106682jad; Sat, 21 Jul 2018 11:31:28 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf+4DyJwELG9lb29rVNPsq548TM2fUyLyNI2gKhVPVPM4+YHOxOd4Vb9yZT1lyQ5tXLevva X-Received: by 2002:a1c:b788:: with SMTP id h130-v6mr4321480wmf.27.1532197888468; Sat, 21 Jul 2018 11:31:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532197888; cv=none; d=google.com; s=arc-20160816; b=KNJ9wzSxlKATmPsAxJHW/GZHE+s2d4uL6JqKUSK04XVgoGIP9zZe47G4e1HoJL8yys bhNBC1DCIfvAVCXrCsE0ehgcTUUAhuxV5VeA7t8hlenv4u+47exGNJD7EIsjtY2FskMa Pf12aTIuLTloZr1nnx1UPzkL7gpPn61P7JPP/PAZEOzuRY0ILtOqIWgkeOfw8qsss3u/ PwI5asbhEwvjGYpxripYSg0ObzpaXPdyvT1L69lnLT0E/UlULed61ajEB0GSKbMntpt0 RqkYOrNPUaLTeUhYVK2USMhcCVUqda8W3Wzo3mD5FvXmYoFc3hLaLI0YALDNMegTikLi 6DTQ== 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=RYOBQYRStAC7Do7g4tRIc/KMayPbBDYSNvY4PtX6tus=; b=S/fdkYBwaaUTp9X3hFDBTbC5clYASl6Co9as5tuQUA/kWwpxdnwjVkgy3iGhjCCqqH M8cMjjUDSgGlgi8dKuPHygy/Uu32v+EBGG34OlMsAeB7yJbxby8ISFwCPFOrnZfCE1cr ZWFlXp6XX2QA8VauHaNMo69FXNYyGDQTR81a06ke2FhhRWy0mfoewcyv6cwmIMC1iNyD UeSohhy9oYiNbD9Ls3UtWw6iV1XXmzJWHhS0PzXyntSpwoEhQU+HR4JXTcFJ8tesDEDG QDG+km9AlduC5NXCGVErOJRyvmoDZ6pn5QrL/VGCMtEKoittoNZ0ewkYURqX1TI62TPu 6pxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com header.s=20161025 header.b="g/U6W631"; 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 s15-v6si3966137wrg.208.2018.07.21.11.31.27; Sat, 21 Jul 2018 11:31:28 -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="g/U6W631"; 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 5749768A08D; Sat, 21 Jul 2018 21:31:13 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-it0-f74.google.com (mail-it0-f74.google.com [209.85.214.74]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A2FAA689AA1 for ; Sat, 21 Jul 2018 21:31:06 +0300 (EEST) Received: by mail-it0-f74.google.com with SMTP id v190-v6so5735853itc.0 for ; Sat, 21 Jul 2018 11:31:19 -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=8X0Nlw9hebtWX1RzqlFsYKRJpU4otM64zbijaeWi32Y=; b=g/U6W631mglEQ9JV8S5ecsQ7GSW4fihK2S0R/r0qOVQn6uAIcw+FKN9PXyF69sRTxY /P1UBdxkoAC2khcgdnAlFYN/ifufBXHy98WEC4+RHVNc/nHfR3ag2pUGfP4oCFPwYY2t tS4ZqcdaItMRgzkQ//CPGQJ5crfa6Kdw8RbwRwLISlM0t9kj20gOL697Lh29+joft0qO 8iP8V4U6SvPnOChbP/1TEXrvZ1Hn2pk7BrUUJybBcJkULH8bOsntfFIofx0uMLPcYw9A J2vxSyUMEoVLhVjqeB67ekLPLfRZ/uyQql3H5nzbSD52Z5Iej2IbOy4ew5mOM2K5jgsx +t7w== 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=8X0Nlw9hebtWX1RzqlFsYKRJpU4otM64zbijaeWi32Y=; b=ZDWHL1xcC527xxLQIAaPLwG+oxMW8AH0emAX8qDpMw7IL0RXDcGq93bdCBUAC7pwcH UrvYT1/ZfK7JTsX5y5zBOZFD6W5nztMiAMU8j9hNIDaEptPzGjjtLywDJzBfbuxyxiFu h9qduUPiMU6wJkBMSBAEpcthXRiC3DZLkceVSPPDsqjDQBRVd4N1Z5Cv62QYOEWkNntK pC0n8fSjfHjN/UE7viBMJ7CXSUy+VbndGEXk6FgStkHsx4GwdDUkr7Y6k3sffFDYYWSv hgF2zDOF/3Xs1QD2vro/R5UBA/phw1E8jYFAunK4lmgHmBO41vhWd8Osfi4ectXzxRu4 8h3Q== X-Gm-Message-State: AOUpUlGcMSvYjIuw1vxaEo6cz7i9372DQHVKjK+uLD6vjYw3YraUd7W1 iRCFxmOXM2pv2AgNL+r0NAeCchKEVaglDcKKuGHT/YgWXxcRvyvcnwmsxNk4tSQU0a1YsZxwW3s irA04YoQOcGDkcTkWUW0PJoG8igXfU0L6K6ZYnNlzQ1Al5HMpDfEk7FQiF/XVEFA= MIME-Version: 1.0 X-Received: by 2002:a6b:a303:: with SMTP id m3-v6mr2722755ioe.96.1532197876687; Sat, 21 Jul 2018 11:31:16 -0700 (PDT) Date: Sat, 21 Jul 2018 19:31:12 +0100 In-Reply-To: Message-Id: <20180721183112.193543-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/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..ec1909dc0c 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->in.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..1cdf97803f 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->in.ch_count; + int nb_out = s->out.ch_count; int num = nb_in * nb_out; int i,j;