From patchwork Wed Sep 28 18:56:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38452 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp443577pzh; Wed, 28 Sep 2022 11:57:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7yaeWiN1XaCognvfFg8LMIbD6Hsv1UQiPBtoaeDGdVpscx9dCthk8bbloYPxyvNir3tunK X-Received: by 2002:aa7:c04f:0:b0:457:1b08:d056 with SMTP id k15-20020aa7c04f000000b004571b08d056mr22197915edo.146.1664391435520; Wed, 28 Sep 2022 11:57:15 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ss17-20020a170907c01100b0077ab738911fsi4760671ejc.140.2022.09.28.11.57.14; Wed, 28 Sep 2022 11:57:15 -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=@outlook.com header.s=selector1 header.b=D+r2esJb; arc=fail (body hash mismatch); 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BD47C68BBE8; Wed, 28 Sep 2022 21:57:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05olkn2085.outbound.protection.outlook.com [40.92.91.85]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1D95468BBB5 for ; Wed, 28 Sep 2022 21:57:06 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nLvaV2x/B1LFhXa3+TAHdC5EjveaZ5LHnvtU446JwFNdWC4zlm7ob6989NctiD+PxVyeuQvJnJWO/jbiNQWLtMu3Cec3pdoONVWFKZTze3oIziTt7pRaLl6ngWzd/VwjSWMixo/6/bvcztId7XFGvby8Aw1UXiSJUwSpfiVz3M2fUJQl7sS4ICbUGp9m4BX98L/IVEw5etfb7+/FgUjWFI5JOwB62LgnxOIdT2Tl+eCgZ3Am19K8Q0iYAl80p8MB5WUZUpBZkvSBclvpCpb2zTNitAVzYeT7z75EQmjl3amlYyM7sdsfqKadF1W0DJYJvTYX71uy7QXg/cxWvVjFhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pSupCD7u0ydRf3UnPQ7ah6j5ggwWw78jMdfrEBYIVKU=; b=oWXjhuSUfoJFexsoqZ47xk7YT+ldMH2Kxy7QRtF4aTpibPKlCqxRYuvyK2l7X+eM2DH6cU9omfrGwvOXMRgrVnuPVxr2sxSCIDH7ExJ8VfJymwY9IrbpIPhrlQCfmU54N/b+XRbgfZ9MHiCdkF8P5qoixMkgETU2lNWYQtM8baC/Ba1+IkSB0uWU815zbo37PNr+286cAH6TRUo+2oqc2H7g+vlqabBP61sddexHNpghIc5qJS+Si+qRonHzS8ncKrfWK4oPn3EKygrd+FdGn4fnXTp/nKVqWE5A52tLk7xDdrNVEBujhD4GqAUB9c1nhneXID5PLjs5jFz7IrFKjA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pSupCD7u0ydRf3UnPQ7ah6j5ggwWw78jMdfrEBYIVKU=; b=D+r2esJb5h8ATIAmAXCOBDgGDmYGdI4gV5+a7ZSBvCCMpcOsD6XRagnXPOOxTDkj6vm/b+O4Kn55ZkDH9MU794xnvqCEbARTJRZdZbVQFi1YB5OVpKcujOQ1glcj9n1zmPqJCl9dzpUEMmQipGzBV/Pme1oR7lMqPmde1I7QGYH5eLi3WW11WwyilbPR+5LQeCXZZ+wA7wqJwXW3KeMLNI8G7vu7VQuFxCbdg9XfAR//5Eq7DEYfd7Zm4XzpTE+xYnRI9Z5zTv8xl82c2fSEB4HfYYJJgrqUxfD/qbfvYs5PUULhwDozN0nLE3Xf1Oq62ZBIt9Ipr6Q1+oEccFESwA== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by DU2P250MB0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:2b7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17; Wed, 28 Sep 2022 18:57:04 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5654.025; Wed, 28 Sep 2022 18:57:04 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 28 Sep 2022 20:56:58 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [waEomSohf6NchLth5iLpI2wA+u3eCfU9I29yNrtkj94=] X-ClientProxiedBy: FR3P281CA0133.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:94::20) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220928185703.1074619-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|DU2P250MB0014:EE_ X-MS-Office365-Filtering-Correlation-Id: bbc59797-4d71-4172-6286-08daa1833b99 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmpPcoZqFl/i/jhf7c/pX34TUjbnGLyPb8pZ1fNimH9z3btIpOSs9LikfBpSDZCuNhEfre45suy3plxSs8zJL1T0jMqTeoTyoCUw+m1KvXQz4GqhiFZvSOXoP6D7bDPPJtW9EFGMNe5SOCi7PLpJ9k/1VtsXm/AW3JsGictk0Wh7mOs8Nm76F8V7rHK35Mog0ix4BimvmtZOfRpFoJ3EOmbIrtda07PxX+kbkyJBweShFGn8mwc937cBFGH8o+khVMHCW7roRMvoDdXI0h+xJBlWu0a7Kvc9NjmezRrDjh3DzbjtQp5JoZGo9XgxUJEQpgbtVPNR84FvNf5kLcO0HJtnW9rpZV2smqUrjydZyHhJP0kqWWHMsV3CyS+0aBDeWOTKpA8ga1LT0nRIxpc98D5/pWqLGVxq2WglQzeBdeJjXKzZNIOHCQnUhTvJP4M/tmqSJ34vu3sgXF18wH9Sidz0rKX/+a2qKqmo+ZTI5zJBdEZkvubQbJOO7TN/CeVmgWH1L9soyJiJ3K3r0cGEuie0A0Ot0WrHp0IOnbKZcWHkLsjqErEWsz9TgX3Gt06yT0SPCCRhnJooaoW+7it+r4oWnCXRLIazswWmfbw1i0Nn879ELzKKhqY8yzSboyWFgdRAycxxsimdGnKbhl6H4+AmIRH4e5Nf7DEmpkk75hlc4NxPDn1XVoxYdSZQcsqDcBeXQBz2i2KxqZCPI8V8x5Lb9GvWcvSE22Hf6cHz2dP2Nr0MZxFCfnxggwp/tJs73Nk= X-Microsoft-Antispam: BCL:0; X-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 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2022 18:57:04.1385 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2P250MB0014 Subject: [FFmpeg-devel] [PATCH 1/6] avcodec/g723_1enc: Remove unnecessary av_clipl_int32() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: buSyjiiW6htV partial_corr is an int16_t and so the av_clipl_int32() never clips and can be removed. This also avoids undefined left-shifts of negative numbers. Signed-off-by: Andreas Rheinhardt --- libavcodec/g723_1enc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/g723_1enc.c b/libavcodec/g723_1enc.c index f3baf7b4ec..a22985ca44 100644 --- a/libavcodec/g723_1enc.c +++ b/libavcodec/g723_1enc.c @@ -200,8 +200,7 @@ static void levinson_durbin(int16_t *lpc, int16_t *autocorr, int16_t error) partial_corr = temp / (error << 1); - lpc[i] = av_clipl_int32((int64_t) (partial_corr << 14) + - (1 << 15)) >> 16; + lpc[i] = (partial_corr + (1 << 1)) >> 2; /* Update the prediction error */ temp = MULL2(temp, partial_corr);