From patchwork Mon Mar 16 11:30:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11440283 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 04D2F90 for ; Mon, 16 Mar 2020 12:05:50 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CEB0020663 for ; Mon, 16 Mar 2020 12:05:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="IW99lAy/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CEB0020663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:37650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDoVA-0006GK-Hr for patchwork-qemu-devel@patchwork.kernel.org; Mon, 16 Mar 2020 08:05:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51682) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDnwu-00021R-9q for qemu-devel@nongnu.org; Mon, 16 Mar 2020 07:30:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDnwt-0000uM-2y for qemu-devel@nongnu.org; Mon, 16 Mar 2020 07:30:24 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:45309 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jDnws-0000og-Rc for qemu-devel@nongnu.org; Mon, 16 Mar 2020 07:30:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584358222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cHmFc0/OXCCi+NT1SDYJ51HQ8KXTFUSMmYS3mQHZnoU=; b=IW99lAy/pzHkdRhwql/YbPjX0bRATYjFB5N7UfGB71qznLdJq6TTBxNIXPlzFBZRmIl57W GcnlzPLg+AWv48TwOagqt6l4ZpR4yIT1qKykFoxudUqwHAql2gxIVlb9Xul7O9ew/tNg9s AEEc0ail1nsnv8C8wWcsF+cKraXWSXY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-169-vbl2EKiCNC6HlDaGBsdDFQ-1; Mon, 16 Mar 2020 07:30:20 -0400 X-MC-Unique: vbl2EKiCNC6HlDaGBsdDFQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 68AA2100550D; Mon, 16 Mar 2020 11:30:19 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-117.ams2.redhat.com [10.36.116.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7154B5C1B2; Mon, 16 Mar 2020 11:30:16 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 8C21E9D13; Mon, 16 Mar 2020 12:30:15 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 1/6] qapi/audio: add documentation for AudioFormat Date: Mon, 16 Mar 2020 12:30:10 +0100 Message-Id: <20200316113015.28013-2-kraxel@redhat.com> In-Reply-To: <20200316113015.28013-1-kraxel@redhat.com> References: <20200316113015.28013-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Volker_R=C3=BCmelin?= , Markus Armbruster , Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Volker Rümelin The review for patch ed2a4a7941 "audio: proper support for float samples in mixeng" suggested this would be a good idea. Acked-by: Markus Armbruster Signed-off-by: Volker Rümelin Tested-by: John Arbuckle Message-id: 20200308193321.20668-1-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann --- qapi/audio.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/qapi/audio.json b/qapi/audio.json index d8c507ccedae..c31251f45b57 100644 --- a/qapi/audio.json +++ b/qapi/audio.json @@ -273,6 +273,20 @@ # # An enumeration of possible audio formats. # +# @u8: unsigned 8 bit integer +# +# @s8: signed 8 bit integer +# +# @u16: unsigned 16 bit integer +# +# @s16: signed 16 bit integer +# +# @u32: unsigned 32 bit integer +# +# @s32: signed 32 bit integer +# +# @f32: single precision floating-point (since 5.0) +# # Since: 4.0 ## { 'enum': 'AudioFormat', From patchwork Mon Mar 16 11:30:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11440309 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 75D5E139A for ; Mon, 16 Mar 2020 12:49:17 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4C5B5205ED for ; Mon, 16 Mar 2020 12:49:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Cpipz1As" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C5B5205ED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:38092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDpBE-0004ff-48 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 16 Mar 2020 08:49:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51692) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDnwu-00021c-M1 for qemu-devel@nongnu.org; Mon, 16 Mar 2020 07:30:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDnwt-0000ty-1m for qemu-devel@nongnu.org; Mon, 16 Mar 2020 07:30:24 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:48390 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jDnws-0000md-RL for qemu-devel@nongnu.org; Mon, 16 Mar 2020 07:30:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584358222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PJxoln7e7LAPr0w6x0CSFvMFj00f8t79mjPRS95ptHM=; b=Cpipz1AsNSfYlOQ1OXdBeB7OqNedADxJ4RQObekJVwKezZtEAiTMkDcBVALsIbZFwQU8Ry gV7RNnXSbR5+4R/D/CpM5WFtL5q1hcsSxeM8kFzxYk7130NCStxaxW1LJJGzQdyYJIYYke lp3zj9WKkoNTxpEVaZYWD9vqHOVMu5w= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-107-XXtxCJIyM3uO3Fir5zYsiA-1; Mon, 16 Mar 2020 07:30:20 -0400 X-MC-Unique: XXtxCJIyM3uO3Fir5zYsiA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4CC9D107ACC9; Mon, 16 Mar 2020 11:30:19 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-117.ams2.redhat.com [10.36.116.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A6F891841; Mon, 16 Mar 2020 11:30:16 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 94BB19D1F; Mon, 16 Mar 2020 12:30:15 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 2/6] audio: change naming scheme of FLOAT_CONV macros Date: Mon, 16 Mar 2020 12:30:11 +0100 Message-Id: <20200316113015.28013-3-kraxel@redhat.com> In-Reply-To: <20200316113015.28013-1-kraxel@redhat.com> References: <20200316113015.28013-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Volker_R=C3=BCmelin?= , Markus Armbruster , Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Volker Rümelin This patch changes the naming scheme of the FLOAT_CONV_TO and FLOAT_CONV_FROM macros to the scheme used in mixeng_template.h. Signed-off-by: Volker Rümelin Message-id: 20200308193321.20668-2-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann --- audio/mixeng.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/audio/mixeng.c b/audio/mixeng.c index c14b0d874ce5..b57fad83bf3b 100644 --- a/audio/mixeng.c +++ b/audio/mixeng.c @@ -268,17 +268,17 @@ f_sample *mixeng_clip[2][2][2][3] = { }; #ifdef FLOAT_MIXENG -#define FLOAT_CONV_TO(x) (x) -#define FLOAT_CONV_FROM(x) (x) +#define CONV_NATURAL_FLOAT(x) (x) +#define CLIP_NATURAL_FLOAT(x) (x) #else static const float float_scale = UINT_MAX; -#define FLOAT_CONV_TO(x) ((x) * float_scale) +#define CONV_NATURAL_FLOAT(x) ((x) * float_scale) #ifdef RECIPROCAL static const float float_scale_reciprocal = 1.f / UINT_MAX; -#define FLOAT_CONV_FROM(x) ((x) * float_scale_reciprocal) +#define CLIP_NATURAL_FLOAT(x) ((x) * float_scale_reciprocal) #else -#define FLOAT_CONV_FROM(x) ((x) / float_scale) +#define CLIP_NATURAL_FLOAT(x) ((x) / float_scale) #endif #endif @@ -288,7 +288,7 @@ static void conv_natural_float_to_mono(struct st_sample *dst, const void *src, float *in = (float *)src; while (samples--) { - dst->r = dst->l = FLOAT_CONV_TO(*in++); + dst->r = dst->l = CONV_NATURAL_FLOAT(*in++); dst++; } } @@ -299,8 +299,8 @@ static void conv_natural_float_to_stereo(struct st_sample *dst, const void *src, float *in = (float *)src; while (samples--) { - dst->l = FLOAT_CONV_TO(*in++); - dst->r = FLOAT_CONV_TO(*in++); + dst->l = CONV_NATURAL_FLOAT(*in++); + dst->r = CONV_NATURAL_FLOAT(*in++); dst++; } } @@ -316,7 +316,7 @@ static void clip_natural_float_from_mono(void *dst, const struct st_sample *src, float *out = (float *)dst; while (samples--) { - *out++ = FLOAT_CONV_FROM(src->l) + FLOAT_CONV_FROM(src->r); + *out++ = CLIP_NATURAL_FLOAT(src->l) + CLIP_NATURAL_FLOAT(src->r); src++; } } @@ -327,8 +327,8 @@ static void clip_natural_float_from_stereo( float *out = (float *)dst; while (samples--) { - *out++ = FLOAT_CONV_FROM(src->l); - *out++ = FLOAT_CONV_FROM(src->r); + *out++ = CLIP_NATURAL_FLOAT(src->l); + *out++ = CLIP_NATURAL_FLOAT(src->r); src++; } } From patchwork Mon Mar 16 11:30:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11440295 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 48E2B1667 for ; Mon, 16 Mar 2020 12:35:24 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1E0D7205ED for ; Mon, 16 Mar 2020 12:35:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cEusEkXy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1E0D7205ED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:37942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDoxl-0000Ds-TD for patchwork-qemu-devel@patchwork.kernel.org; Mon, 16 Mar 2020 08:35:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51742) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDnwx-00022I-QR for qemu-devel@nongnu.org; Mon, 16 Mar 2020 07:30:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDnwv-0001Cv-Cb for qemu-devel@nongnu.org; Mon, 16 Mar 2020 07:30:27 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:45755 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jDnwv-00018P-71 for qemu-devel@nongnu.org; Mon, 16 Mar 2020 07:30:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584358224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k2+gky+iQX2sRF3Cj4Ap1jl4jZVwiMISvIxm8ts03s8=; b=cEusEkXyJso773L8pDQiHsjEOR+9UyHtoyE+gft2kqDXclXO4fo/kMH+5mrvyRtWGo3Pdh iIKrWQgMmZVWwEEZQ88zLblGFALCSbl6FrRpH2qQuIcDk0LtN08Q7xJULRbiNbA8SqArHO hdhyvyujq4sQeKfPWQG88vSCe6yN9+Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-367-Ze1VJ06pP0egSUsibdhZKw-1; Mon, 16 Mar 2020 07:30:20 -0400 X-MC-Unique: Ze1VJ06pP0egSUsibdhZKw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 79BAD8017CC; Mon, 16 Mar 2020 11:30:19 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-117.ams2.redhat.com [10.36.116.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 64C165DA2C; Mon, 16 Mar 2020 11:30:16 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9D20D9D21; Mon, 16 Mar 2020 12:30:15 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 3/6] audio: consistency changes Date: Mon, 16 Mar 2020 12:30:12 +0100 Message-Id: <20200316113015.28013-4-kraxel@redhat.com> In-Reply-To: <20200316113015.28013-1-kraxel@redhat.com> References: <20200316113015.28013-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Volker_R=C3=BCmelin?= , Markus Armbruster , Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Volker Rümelin Change the clip_natural_float_from_mono() function in audio/mixeng.c to be consistent with the clip_*_from_mono() functions in audio/mixeng_template.h. Signed-off-by: Volker Rümelin Message-id: 20200308193321.20668-3-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann --- audio/mixeng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/mixeng.c b/audio/mixeng.c index b57fad83bf3b..725b529be7da 100644 --- a/audio/mixeng.c +++ b/audio/mixeng.c @@ -316,7 +316,7 @@ static void clip_natural_float_from_mono(void *dst, const struct st_sample *src, float *out = (float *)dst; while (samples--) { - *out++ = CLIP_NATURAL_FLOAT(src->l) + CLIP_NATURAL_FLOAT(src->r); + *out++ = CLIP_NATURAL_FLOAT(src->l + src->r); src++; } } From patchwork Mon Mar 16 11:30:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11440297 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CA026139A for ; Mon, 16 Mar 2020 12:35:56 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A0D2C20663 for ; Mon, 16 Mar 2020 12:35:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PTRjw5Y6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0D2C20663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:37956 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDoyJ-0000Rw-Dt for patchwork-qemu-devel@patchwork.kernel.org; Mon, 16 Mar 2020 08:35:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51710) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDnwv-00021u-DZ for qemu-devel@nongnu.org; Mon, 16 Mar 2020 07:30:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDnwt-0000u8-40 for qemu-devel@nongnu.org; Mon, 16 Mar 2020 07:30:25 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:38300 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jDnws-0000kN-Rd for qemu-devel@nongnu.org; Mon, 16 Mar 2020 07:30:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584358222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mE4yFR491f4j8PDDbu5efgbzaxaT645qB190m9RUtLA=; b=PTRjw5Y6OMpMtrNWeaP4LwswEf36zqzNUilB/OQsYdgxR8mOIEkU7YvtMseaBqMHFMcLFf PrPJ2iTS6bp26uxdDYCeZHUY2U0fVBnjT5rT06ky6axEoxviAIf1tLRWqLE5iEcpZ4LXxi njbmZReYF2h/Y1daDO0m8/a4JCGDjpA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-424-w1VAybSwOH6gU_-jpZ2bPw-1; Mon, 16 Mar 2020 07:30:20 -0400 X-MC-Unique: w1VAybSwOH6gU_-jpZ2bPw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5E21A800D4E; Mon, 16 Mar 2020 11:30:19 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-117.ams2.redhat.com [10.36.116.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6E8638FC1E; Mon, 16 Mar 2020 11:30:16 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id A73359CA5; Mon, 16 Mar 2020 12:30:15 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 4/6] audio: change mixing engine float range to [-1.f, 1.f] Date: Mon, 16 Mar 2020 12:30:13 +0100 Message-Id: <20200316113015.28013-5-kraxel@redhat.com> In-Reply-To: <20200316113015.28013-1-kraxel@redhat.com> References: <20200316113015.28013-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Volker_R=C3=BCmelin?= , Markus Armbruster , Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Volker Rümelin Currently the internal float range of the mixing engine is [-.5f, .5f]. PulseAudio, SDL2 and libasound use a [-1.f, 1.f] range. This means with float samples the audio playback volume is 6dB too low and audio recording signals will be clipped in most cases. To avoid another scaling factor in the conv_natural_float_* and clip_natural_float_* functions with FLOAT_MIXENG defined this patch changes the mixing engine float range to [-1.f, 1.f]. Signed-off-by: Volker Rümelin Message-id: 20200308193321.20668-4-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann --- audio/mixeng_template.h | 17 ++++++++--------- audio/mixeng.c | 4 ++-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/audio/mixeng_template.h b/audio/mixeng_template.h index 77cc89b9e808..fc8e1d4d9ebf 100644 --- a/audio/mixeng_template.h +++ b/audio/mixeng_template.h @@ -41,32 +41,31 @@ static inline mixeng_real glue (conv_, ET) (IN_T v) #ifdef RECIPROCAL #ifdef SIGNED - return nv * (1.f / (mixeng_real) (IN_MAX - IN_MIN)); + return nv * (2.f / ((mixeng_real)IN_MAX - IN_MIN)); #else - return (nv - HALF) * (1.f / (mixeng_real) IN_MAX); + return (nv - HALF) * (2.f / (mixeng_real)IN_MAX); #endif #else /* !RECIPROCAL */ #ifdef SIGNED - return nv / (mixeng_real) ((mixeng_real) IN_MAX - IN_MIN); + return nv / (((mixeng_real)IN_MAX - IN_MIN) / 2.f); #else - return (nv - HALF) / (mixeng_real) IN_MAX; + return (nv - HALF) / ((mixeng_real)IN_MAX / 2.f); #endif #endif } static inline IN_T glue (clip_, ET) (mixeng_real v) { - if (v >= 0.5) { + if (v >= 1.f) { return IN_MAX; - } - else if (v < -0.5) { + } else if (v < -1.f) { return IN_MIN; } #ifdef SIGNED - return ENDIAN_CONVERT ((IN_T) (v * ((mixeng_real) IN_MAX - IN_MIN))); + return ENDIAN_CONVERT((IN_T)(v * (((mixeng_real)IN_MAX - IN_MIN) / 2.f))); #else - return ENDIAN_CONVERT ((IN_T) ((v * IN_MAX) + HALF)); + return ENDIAN_CONVERT((IN_T)((v * ((mixeng_real)IN_MAX / 2.f)) + HALF)); #endif } diff --git a/audio/mixeng.c b/audio/mixeng.c index 725b529be7da..739a500449ce 100644 --- a/audio/mixeng.c +++ b/audio/mixeng.c @@ -271,11 +271,11 @@ f_sample *mixeng_clip[2][2][2][3] = { #define CONV_NATURAL_FLOAT(x) (x) #define CLIP_NATURAL_FLOAT(x) (x) #else -static const float float_scale = UINT_MAX; +static const float float_scale = UINT_MAX / 2.f; #define CONV_NATURAL_FLOAT(x) ((x) * float_scale) #ifdef RECIPROCAL -static const float float_scale_reciprocal = 1.f / UINT_MAX; +static const float float_scale_reciprocal = 2.f / UINT_MAX; #define CLIP_NATURAL_FLOAT(x) ((x) * float_scale_reciprocal) #else #define CLIP_NATURAL_FLOAT(x) ((x) / float_scale) From patchwork Mon Mar 16 11:30:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11440279 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 32FA913B1 for ; Mon, 16 Mar 2020 12:00:52 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BBCD920663 for ; Mon, 16 Mar 2020 12:00:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="T8SDcMLR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BBCD920663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:37588 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDoQM-0004Xt-0r for patchwork-qemu-devel@patchwork.kernel.org; Mon, 16 Mar 2020 08:00:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51794) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDnx1-00023G-7x for qemu-devel@nongnu.org; Mon, 16 Mar 2020 07:30:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDnwz-0001i5-Sd for qemu-devel@nongnu.org; Mon, 16 Mar 2020 07:30:31 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:51121) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jDnwz-0001bm-Ni for qemu-devel@nongnu.org; Mon, 16 Mar 2020 07:30:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584358228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iI7EvAcPsxErgC/GJdfEIFJRdfocYN4FRixDOCOaMns=; b=T8SDcMLReJf7TO+dlBVT3GCyCxtsenVm5gsTzbwrUrUOiL00IryYrO4sOq9IkSbgL6QtQU rihzOHMmrzx17FNKFh3IZIKkXtHskpxsFeMNb7TE1LDcv6O5MAWUpEtYI0Xb9/n/DCWhXt ybTKx0iZ28UdNg/gkTh92in/92Aj6AQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-8-_QrWc6D2O86WAG2vHHlH-Q-1; Mon, 16 Mar 2020 07:30:26 -0400 X-MC-Unique: _QrWc6D2O86WAG2vHHlH-Q-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 570A4DB21; Mon, 16 Mar 2020 11:30:25 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-117.ams2.redhat.com [10.36.116.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1AC1060BE2; Mon, 16 Mar 2020 11:30:20 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id AFB4E9B0C; Mon, 16 Mar 2020 12:30:15 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 5/6] audio: fix saturation nonlinearity in clip_* functions Date: Mon, 16 Mar 2020 12:30:14 +0100 Message-Id: <20200316113015.28013-6-kraxel@redhat.com> In-Reply-To: <20200316113015.28013-1-kraxel@redhat.com> References: <20200316113015.28013-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Volker_R=C3=BCmelin?= , Markus Armbruster , Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Volker Rümelin The current positive limit for the saturation nonlinearity is only correct if the type of the result has 8 bits or less. Signed-off-by: Volker Rümelin Message-id: 20200308193321.20668-5-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann --- audio/mixeng_template.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/audio/mixeng_template.h b/audio/mixeng_template.h index fc8e1d4d9ebf..bc8509e423f6 100644 --- a/audio/mixeng_template.h +++ b/audio/mixeng_template.h @@ -83,10 +83,9 @@ static inline int64_t glue (conv_, ET) (IN_T v) static inline IN_T glue (clip_, ET) (int64_t v) { - if (v >= 0x7f000000) { + if (v >= 0x7fffffffLL) { return IN_MAX; - } - else if (v < -2147483648LL) { + } else if (v < -2147483648LL) { return IN_MIN; } From patchwork Mon Mar 16 11:30:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11440269 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9BA6E14B4 for ; Mon, 16 Mar 2020 11:49:51 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2FE36206E2 for ; Mon, 16 Mar 2020 11:49:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="a4wL3OeQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2FE36206E2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:37490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDoFh-0000Il-M0 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 16 Mar 2020 07:49:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51743) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDnwx-00022L-R1 for qemu-devel@nongnu.org; Mon, 16 Mar 2020 07:30:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDnwv-0001Jc-Ty for qemu-devel@nongnu.org; Mon, 16 Mar 2020 07:30:27 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:35870 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jDnwv-0001EM-NW for qemu-devel@nongnu.org; Mon, 16 Mar 2020 07:30:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584358225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7J+l2f0f5/ilb8YWNAi54ox7ychi5H954THscGoohqo=; b=a4wL3OeQQbC309kBfc4MZNEpD7Ov2c/RDIWlNvp2xgMzSD1ySWUx+R5e1uPwQqPDE38ZNx TgUbHm4INm8yOTG9PCEvSaS96K/WjjCKO5jAHoqGEO0xpnUXZW39AIlVjlLOrh8BHF/8PL S+f/021FszzOzTpAg9aWXykFSlPgKNY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-43-2N1l5TA4PP6m6EW1ws-mSg-1; Mon, 16 Mar 2020 07:30:21 -0400 X-MC-Unique: 2N1l5TA4PP6m6EW1ws-mSg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 608BF1005509; Mon, 16 Mar 2020 11:30:20 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-117.ams2.redhat.com [10.36.116.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 18E6610016EB; Mon, 16 Mar 2020 11:30:20 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B87D49AF5; Mon, 16 Mar 2020 12:30:15 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 6/6] audio: add audiodev format=f32 option documentation Date: Mon, 16 Mar 2020 12:30:15 +0100 Message-Id: <20200316113015.28013-7-kraxel@redhat.com> In-Reply-To: <20200316113015.28013-1-kraxel@redhat.com> References: <20200316113015.28013-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Volker_R=C3=BCmelin?= , Markus Armbruster , Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Volker Rümelin The documentaion for -audiodev format=f32 option was missing. Signed-off-by: Volker Rümelin Message-id: 20200308193321.20668-6-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann --- qemu-options.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 1d8f852d8969..962a5ebaa67a 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -551,7 +551,7 @@ DEF("audiodev", HAS_ARG, QEMU_OPTION_audiodev, " in|out.frequency= frequency to use with fixed settings\n" " in|out.channels= number of channels to use with fixed settings\n" " in|out.format= sample format to use with fixed settings\n" - " valid values: s8, s16, s32, u8, u16, u32\n" + " valid values: s8, s16, s32, u8, u16, u32, f32\n" " in|out.voices= number of voices to use\n" " in|out.buffer-length= length of buffer in microseconds\n" "-audiodev none,id=id,[,prop[=value][,...]]\n" @@ -647,7 +647,7 @@ SRST ``in|out.format=format`` Specify the sample format to use when using fixed-settings. Valid values are: ``s8``, ``s16``, ``s32``, ``u8``, ``u16``, - ``u32``. Default is ``s16``. + ``u32``, ``f32``. Default is ``s16``. ``in|out.voices=voices`` Specify the number of voices to use. Default is 1.