From patchwork Tue Aug 31 12:40:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 29909 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp4886731iov; Tue, 31 Aug 2021 05:40:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDgWadMxDi8+Pzz3tcLGgsa+ml2T/Kf/136c5Mz49tcqlKc9M2RlmVqJyNlSme+LN4FqDT X-Received: by 2002:a17:907:3e03:: with SMTP id hp3mr31810673ejc.183.1630413646692; Tue, 31 Aug 2021 05:40:46 -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 cw25si16887076edb.390.2021.08.31.05.40.45; Tue, 31 Aug 2021 05:40:46 -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=Ud+XNqlS; 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 8606E689FB2; Tue, 31 Aug 2021 15:40:40 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-oln040092070064.outbound.protection.outlook.com [40.92.70.64]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B30D368980E for ; Tue, 31 Aug 2021 15:40:33 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=arV7e5S6vMABa0oBGZJWqNKNgxJe7NP6MscDLYllocZ+J2eH5fUEmXJ0vP+CV+Oi/0xa5xHry9TPglDZ+U4/mhMKj+VjVrVM/+5yNsv6pSokjb9KQ9xq8Xni3ICI+k7QRBpLCBduPe9xnD1ZrK2y/5bCd5rWpV2hSixaeGyQ6asOh1wXdy+FEfk3Puy2bzs5qtn4icwGHXSRXf/rwyl+ualeMQP9VVM9srthsYqRlTXYhVZ8o08KfgX/nQ6yiX2tGlkYeNbe188khpkKLiAKjgjrCDM7TYJbp82DqnKpjLdpnDfNqlpNiB7vCxadOTq+hzzMH+tVdFkPa7W78O5DVQ== 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; bh=5Vy+gzE9lJ7aj4fN2sBOH9wx2RGzMsVPOeGLuILZCOA=; b=a7bxCa2uHuRv3iDSrXXJSMFkY8UilhEHZMygOugmUqZHilfgOvL4+93UNgo79POXwhKHa6JQkYkrBk/IAQJBulq14tJk5BBNKFgYJyAEgC5PKdKCYo0SbViCs22fBoYwNGN76aJjoLRyT7yWFoSzbt2JT2eUa3RavNLiJrhJrwISIVekR21CpmLqQ+g97dG6mvKyXkfJJIpKBikl9Z7VHBSmR7b97WQcKVbYgIfUw9aPIs8F7ckRgK/3UypqHe6nsaIbGOzpU54WmNx3NNcpUBINQtbDb1w/LtwgtaAaaaPiKUia270dutQ2z8dCbxBgE7sOMg9+sLtKvG3CZr2VEw== 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=5Vy+gzE9lJ7aj4fN2sBOH9wx2RGzMsVPOeGLuILZCOA=; b=Ud+XNqlSo6d9kNU1laijGJlkE68cY88fwKc4fPUu4WUDG2XLvKR6hNCpNvkX9TLS4ZkZeTxdXtLuaH0Mo+2IPdGnqSFbIvhtJ7IQHebz/qYRSqGxRr8ZsMs6oOd4P5mg56eVxFq2kM6wP1j9DS7ixt5XGRsKsakV1lTQDcv7C3ZVhYXGEfy4gTA19PsVxm53amKZ69XN6iDBJSmZrNlKXGhq8EkA562qGRn9bD0UBVHNxBKi6YOvbLs7RamI4CaZqpBh1roSErZl6ztY4g5tIjBBwvf3s3NNGizQMbw0pA9o0DKwooVJHb525JVzW2Jz51PmTvLxzoLSPNi6xEttXA== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM7PR03MB6197.eurprd03.prod.outlook.com (2603:10a6:20b:133::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.17; Tue, 31 Aug 2021 12:40:32 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5%7]) with mapi id 15.20.4457.024; Tue, 31 Aug 2021 12:40:32 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 31 Aug 2021 14:40:14 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 X-TMN: [ohptCxeVmVV02nkaRgMcV0dlswFUUu59] X-ClientProxiedBy: PR3P251CA0021.EURP251.PROD.OUTLOOK.COM (2603:10a6:102:b5::20) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210831124023.1715782-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.142.38) by PR3P251CA0021.EURP251.PROD.OUTLOOK.COM (2603:10a6:102:b5::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23 via Frontend Transport; Tue, 31 Aug 2021 12:40:31 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a068e81b-8332-43ef-0489-08d96c7c856c X-MS-Exchange-SLBlob-MailProps: q+fD6XS3/UJ964kuwYCa+J9EOyBQgCazMC3vC85rpadPEcVSRcoVGRc8mmLZRV2ghrFWgN7vWd1b44HqM/9i2aaVkOCDGL+Bcz22RKEFnCWldKFrzvYDdV3OWBojcU0kGdXINjho8v9rPeARhvCpoCdBr63msjn/cC9xk2P2w/A4sRx00jl9JZBoTat1pYBW//APZ0L0fP1RFU5fhapVL024Lxo4e9/PgEfutz+S4bcg4iSPYTrtAjSIGQJrpEZUYpHYWGrXjN9mBN4DvnExY4Q3HRaGU8Wdfi/1mcNnDVQ1DA/4/42Ln2/C0RUjduhOtZEnmdYeGKwyIwNwz1mCPhlRVJSqdHhcSGJIs1Cb3iq1ju2iq7NOlpq82m/7hEzJHdAkMhZPwrIVLfaz0jADVSUCMNJb5kMqsCP/t5yBcntBBAO/BtiMuDNdgzcis7GYaYOZZQVRKPjXgl4DD7FamcNrtEKiNU/WS9Is4xmLJQwDd9uSsvKX9SNLtsKoUlJxh1gdQ9E1fVvLu9w49jeZO5L+ilQnyvOirfkehegtESCgk6pjp42GD6Hz5+vQZ+OnxjP82vEzHAVtpCwYi5i18cKcvUBF6HeMxA8XbYpWWBHyJh1pZz/qQy12eiKCCS1tuE0gXBODlJ9NzLRsd4QgaEAazMQxHc/SyaZ/8ydI0ypjPnY+hSJumiKhnt2nG6ih4FpK5H6v0JCq2Sf4tSz10Q== X-MS-TrafficTypeDiagnostic: AM7PR03MB6197: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GvbLNfiyHTZDyNc85B67G4txJgok77urkO+BuAsyCXz719q0prjhMWDLh0YiUEFXW1mfEVtud3ksMsxLE1dzHXpVUBjggYoq1XaFHKXlgLkWs+KJpMAI0DG5h8NJ8dArH4LFaME+Ac3Miiv5n82PBC+PbbQmz9kbSNI9aJIVWFlxMN0V1fhw0BDt/b0WdAKZY2y2w9l3uvrfYyhhdxp116F6IvyZh+q2uXm5Y/+7ATb5tpYjjvgHvOq2tz0RGpQDkFFYMXjdMx5Zt9s2PAn9plsGYgLYChlbj/tIRNgcqZ67R04EQh6x8ggmmfVqfl1HvU8eOGd06WjlrFUO271v6O633hOegxvSy7tzm4tQeHoEXrPesmtr8tI17giaDuf2g3sN+jjaiTh5v0FV7GYDqRnvbGw64qAK10UPlX9Fr+aU+BFk98AzeRxnJoD/Oucx X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Oh14EjU5m93+wFTAv1l+W/UJsva5WhFoDYXFUpUXcpLhuFpjdk7eEcINeBhoMPSOmbeUzoSCpXbZNx8daZef7sxBRsiIReZ/e2uPWqmfdjXrnSqIFBJIXRoxRsB7gMIYACQqD8EESZv+COxAsa0+9A== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a068e81b-8332-43ef-0489-08d96c7c856c X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2021 12:40:32.4090 (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: AM7PR03MB6197 Subject: [FFmpeg-devel] [PATCH v2 01/10] tests/fate-run: Allow multiple inputs for transcode() 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: 5cCKrMMynDOj This allows nicer tests by having a greater range of inputs available (without requiring adding further samples to the fate-suite). Signed-off-by: Andreas Rheinhardt --- The cover-art test that was included in version 1 of this patchset and made use of this didn't pass on PPC and has therefore not been included in this set. tests/fate-run.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/fate-run.sh b/tests/fate-run.sh index bc1efa22d7..4b21bab591 100755 --- a/tests/fate-run.sh +++ b/tests/fate-run.sh @@ -232,12 +232,13 @@ transcode(){ enc_opt=$4 final_decode=$5 ffprobe_opts=$7 + additional_inputs=$8 encfile="${outdir}/${test}.${enc_fmt}" test "$6" = -keep || cleanfiles="$cleanfiles $encfile" tsrcfile=$(target_path $srcfile) tencfile=$(target_path $encfile) - ffmpeg -f $src_fmt $DEC_OPTS -i $tsrcfile $ENC_OPTS $enc_opt $FLAGS \ - -f $enc_fmt -y $tencfile || return + ffmpeg -f $src_fmt $DEC_OPTS -i $tsrcfile $additional_inputs \ + $ENC_OPTS $enc_opt $FLAGS -f $enc_fmt -y $tencfile || return do_md5sum $encfile echo $(wc -c $encfile) ffmpeg $DEC_OPTS -i $tencfile $ENC_OPTS $FLAGS $final_decode \ From patchwork Tue Aug 31 12:42:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 29915 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp4888383iov; Tue, 31 Aug 2021 05:43:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7HKMjm0VV3Dql6j2A6foUpYjbL6Jxhze2b/Kf2/lw0BqRMKEwXuWetuNOmQLheZpDCb4t X-Received: by 2002:a17:906:8597:: with SMTP id v23mr23602721ejx.178.1630413800250; Tue, 31 Aug 2021 05:43:20 -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 g23si18160392edp.82.2021.08.31.05.43.18; Tue, 31 Aug 2021 05:43:20 -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=ZBfdlRYT; 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 A78B8689FB2; Tue, 31 Aug 2021 15:43:15 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2025.outbound.protection.outlook.com [40.92.89.25]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0656F6802F5 for ; Tue, 31 Aug 2021 15:43:09 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dvVBOLWF2wxs0TMEE8mRmcoWD+vcb42XxNwCdbmq156MfbEFq22vO1jeSqWT07Y5ZFR85dIHf8TXbfHvh+of3zqqUp1BszO3+3JOE2IUKB6aNv8WtCmCIHYx3AhOQ5n8h2n/tGB8VKJ+3YCMcfGpxPhNZx303V9zlVACT9ouBmBNbRiK6el4gm4ud9F87VOQNUdAvgQw8QSh2KkUhYD9pxOn/WfOQQF3mZDBF2cFwDwhLmJ9R/KyufBQyy2kA0DUOw3rtubs4DysQfP3kQZlexGW6Yg+LXelfvXx7fVbK11xDir6tzrRAIS5NmofTvkKsiPZ2QxIUXcLs9JDKY9Hqw== 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-SenderADCheck; bh=Qxc+1U+HnXKIO2mnt0jFUhTdD64Ax578x/JVM6vQkeI=; b=ChaLUBhhN8bO1KVQ9is99L+cYNIvOtAkvxtYatCzhZp3wSfqmSibQWo2Dzj4QzIBdwXWGpl4RDBYxu97R8blad3eONDbQeJn8obyPupzoABy2Zz9/6t2QQkDRd+sjMZUjlNDD5Wd41WAzM3tGNhwX3Qs0AgnB/0fytaxQ1eIVopqf5/tezrLhJ03HlkbwVE1XZbURAOOOJHqS1vhOXpr/hOqsQFoCxVFqcpE7D5JZjIQ5EQGkq8IRS4LUmPzXnL66OtMmLV5pw0mCCcLFDwzM/SXQspwOPBL5e9nBlxlcf+qIfB9SqqjedFgTgNHWOsyPh8Aaa5SDpe2S5E1XatdTA== 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=Qxc+1U+HnXKIO2mnt0jFUhTdD64Ax578x/JVM6vQkeI=; b=ZBfdlRYTg3JtODFf+gzLRmYmSDv9rErOAmofEMnhrtywzUhVJZYzcLM5M6930Ct15LTa+7TcixGNXWgGedtXBx+JvQRzgZ+1XksSRyh2WWjsrn+N9RjZ7LessWNnz7ozTrxRkMqOHVFvnVYRDiVvrPwNDSGW/EZaXVKqHoTUCSjEThSz1LWUf6QKrIguylIP9H6oEW9mF0YE7fV9aQhW6zQi7fFc3NtRdJ65KiB0is8EWZ73a6AfWjkjsd76W3LI/lFnJ7qeiWncPxaP3bO2G3YW+dh5fo9WmpSqFnsJ6KdY3U9tum+wzuU6NTjnDuNjX5AMF6WHWhSdyIFuLsy71w== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB6005.eurprd03.prod.outlook.com (2603:10a6:20b:e2::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.20; Tue, 31 Aug 2021 12:43:07 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5%7]) with mapi id 15.20.4457.024; Tue, 31 Aug 2021 12:43:07 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 31 Aug 2021 14:42:50 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [b8cH3jh1SlGc88eO3wxbDqj1fUsZd+bL] X-ClientProxiedBy: AM9P250CA0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:21c::19) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210831124258.1715917-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.142.38) by AM9P250CA0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:21c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23 via Frontend Transport; Tue, 31 Aug 2021 12:43:07 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 81c5eebe-f1c2-4822-0f82-08d96c7ce1e7 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiSWRCC5t5rxqFZL3PDFc5wfoV4e8I7SD0xLd/WXxj/j/7Dc/PnCJmw0icRtGNubwLhtJeMGbnUJvRnkkGdHi7A6j2OpMZuZGPfeLxoaJ5t2ShyrhchxqlTaNFgR4clHxUkyQhivzwDyOuGI2iKL93xStz0MoVvyPRxdw0N9gIXmMw8TDFquCtaVbYyGdcnVHb9exmPu42UQGbAlJK2vc0OCoFJNIX0B7RXoq3WdhiUF1OnlJ3A5d7Ie2dcX8SGZO2mWLA132dr0I1wRjd0Ovn8zPlS2gM7Gsq7P/agEiq9hzUus39jJUtzmXCwKsYSU+nCax5ORD2aZzbg5HsuqQlITkHSd3PwhZd3jJT7oDrOSQ0xHNUcONfDWVOMBtIkakerbMzYA3Pw3+x/XugwyF12xROgJ/3xJJum4iYcZ4XrryjFkthTU1NeZ+ujp9Z5wUzN0v/bhU89Rhqa1VfgaWwdhashwwc2nAwA1e181NTogvrHmOiVN/Z1pgy45bSWbT0SwedC7piW9OGvAt9f7w//aKCV8QTHh7fF2Uv6vRSnOXF7skL1IdDHMuseh4LpRVexMnCgx1aRg9+wgAUms+9NT2te994LTks+z9ocYS7h4dqVqYNXucwQ+1bHECdkocoKMj/jrc7MayLoewxLjmipCkeAbbVo9dP6wjI4y/xUT4iA6hI6Pnxmc3muqsYE2ugaEiLVN1BJzgG7PBevswwHX9VNXl2PVFZF0HPE7CGEyc4ChwhCQGXthIWwD2Vy18wE= X-MS-TrafficTypeDiagnostic: AM6PR03MB6005: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oudYpNJizwkhqGXey4BrLBtsmSCl2svTnVkeNg8TIcQx3f9W34Msc3Iav3/kzDRgIGqq6mUT0CNsawv5m6m5xJc2ijpIIFPtRYG6iP0C2xqNZcajrjjkqanawa03h5K4rDbGrSOn7X0j7Hp5AKiMK5yPBSKYEt/wVd6eFgJijeJtD51crtGT6IfpkFgdZnqvZEQptnbssgRgFrXeVCoxrFEJ92WWT4SXmtNnu8sWi0Q3ZntPGEIFeN0A3GnVe5CsfQXl8i6xPguhi4MYLNBTDygOiRLSgAeVlAkQeWN3vbsgR/3v6tfORSejCVghKMhp9jGCIDJu+bIwJKSJEjS+Wsx6WhAXU97aCpkUtDCCzpMJ9nk93CW7qiNzHV1n5gk9T20qivD2CFcszA0rv9P2nui+mAfZLrtpNzhLT+OxOdY57zfFIFxShhiNzH/efcTe X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rQyXw6KSBo1q6RexnDlBALtpRznn1UxiWRVYCuojyQg8MYFkpTAJex7cYeD30Wzcf0PP9DrFI/TrbUXzXhI3FWX4t6sydSqqqgimcrO77TG8LBlq67rPnRge8S/CjZd8aXFCenoItb2Ud+H0dhEdVg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 81c5eebe-f1c2-4822-0f82-08d96c7ce1e7 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2021 12:43:07.3308 (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: AM6PR03MB6005 Subject: [FFmpeg-devel] [PATCH v2 02/10] avformat/flacdec: Also set channels when setting channel_layout 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: enTo0LcaERty This brings the FLAC demuxer in line with all the other demuxers. Furthermore, if it is not done and the FLAC decoder is disabled, the FLAC parser will overwrite the channel layout with the standard channel layout for that number of channels. Signed-off-by: Andreas Rheinhardt --- libavformat/flacdec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c index 2060b48c69..d52434d2f9 100644 --- a/libavformat/flacdec.c +++ b/libavformat/flacdec.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/channel_layout.h" #include "libavcodec/flac.h" #include "avformat.h" #include "flac_picture.h" @@ -192,6 +193,7 @@ static int flac_read_header(AVFormatContext *s) "Invalid value of WAVEFORMATEXTENSIBLE_CHANNEL_MASK\n"); } else { st->codecpar->channel_layout = mask; + st->codecpar->channels = av_get_channel_layout_nb_channels(mask); av_dict_set(&s->metadata, "WAVEFORMATEXTENSIBLE_CHANNEL_MASK", NULL, 0); } } From patchwork Tue Aug 31 12:42:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 29911 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp4888490iov; Tue, 31 Aug 2021 05:43:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxib8gp6jSdb5qXD5RQ2YuRPobw9FH5jpd5+bPxSxyhn55TPP+akFQPpAlHwFZagGseLplA X-Received: by 2002:a17:906:93ef:: with SMTP id yl15mr30991737ejb.229.1630413809585; Tue, 31 Aug 2021 05:43:29 -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 r23si6433132edy.60.2021.08.31.05.43.28; Tue, 31 Aug 2021 05:43:29 -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=p7Dq9hL4; 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 A490568A134; Tue, 31 Aug 2021 15:43:20 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2065.outbound.protection.outlook.com [40.92.90.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CE866689A0D for ; Tue, 31 Aug 2021 15:43:13 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lk8EmZU62HpaGSkPUjihoLLbMb+sDy5pizO07XUYiU1y/25gqg+GeV8hBhRHaj8eq94Qqpn1IOZOY7RdyavMgUJiY6FAzzE7+M5qaXN70kTXhO3Q21VCl3GQBaCJRqyq4xoh70nry4aepyzmTMCOcg5dIpNjxJNBSZ0bdyGBi6WEPheKlROzNChsXCYouoCZPWRHXRdl1lRt7EE3glmohgciov7WJTk+G4xWIipcMj+EM54Xb2GrRYfLI+zeEdpxAj0a3WNJYkM0NOHvmvGmdk6Mcr2d7mrnvni5I/1XWWSRCvO6p9pbHJ4SD7LHqKfDFXikHwaLrrYaVXoBGbMAKQ== 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-SenderADCheck; bh=4Cxw/MW1QprSE6gi6kIGMAphrUhbptRjSCrprnSratQ=; b=RWf51XD89Ge02+KTPUjOjlDicnH1BMNUjCTynvzCqNQcK/uABOYZEsEDAGl7Q1YXGdP+Zj9XPoTF4szrCvmTIDHp1LWDZKslhSYxcn50LFfuua8mfkNBU42ObPVIfpCE1PuZuWDZBlV3zSxj+Z/9Oys4N57N+EFTvwgxl9qGCnmczTz1YNuBfd4k1TRNdHJ59fNiuqmA6rGuOMR8P0LSHCYmWviSNi6cpXginR9Qdd6UtatddSCsPXJ2scNCgchHnehHIxo+/Csc0J4GSpU4IN6P+C4V3VlKgpxAe6/7QrdtZH1SXgTSNaZlR0Ne0euf7Gag19IcxAMy22xaTKZ3Dg== 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=4Cxw/MW1QprSE6gi6kIGMAphrUhbptRjSCrprnSratQ=; b=p7Dq9hL4XqtGpM++8OTWIYHXz3WI5wgx4Bj7drJ3I60BDChdBVyK2dqBmr6Uy438wIq26DrkUR9YQhQM0j5HjIb636H4Efn97/rSVOXnTzNaMKsGGuh6QjEQmvQH+p7KinpeibTKKTSaypfFgj9WbYqGxeiU2RMxUxXAGF5dkzLBp8ZOG9CKj/c15G5b/joNzntuf4KZQ0NiK4Ip71QT5D9dTOBNqgy071hypBgRIifT1hSUOYvq6QzX3YUap2iHE8P5cOEjqNh/uwIH+3NiU0smE49vl/jE/zdjw6QPNmwpaC1nBFYp+fHOctLjKsipt93D19vmg1c06KzRhHNmgw== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AS8PR03MB6824.eurprd03.prod.outlook.com (2603:10a6:20b:29c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.22; Tue, 31 Aug 2021 12:43:13 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5%7]) with mapi id 15.20.4457.024; Tue, 31 Aug 2021 12:43:13 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 31 Aug 2021 14:42:51 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [kn8nGaFIjLuW8eg1yvqQYV/5NqyGDX/E] X-ClientProxiedBy: AM9P250CA0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:21c::19) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210831124258.1715917-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.142.38) by AM9P250CA0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:21c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23 via Frontend Transport; Tue, 31 Aug 2021 12:43:12 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c6c98e45-e208-431a-37c6-08d96c7ce551 X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNVAewO3OwszBVL1NI+kAPIBvLKarEeXor/uFwBq9KfHm29aNTAuijW3wQKsNfh3epb9vRSds6G6vc9jvGLqZTnsiR9VbdNWKi/YS/VHGFZDdQBpJTv9vkrMNNW2/c9zf5xYBU7NbU/xOGUDZBuIjjDCJaxKj/lNxWfWzNLfCEOLCL2pjOKn6Dqtzg7RECmWPa8nUfom5VCg6qr+gzAsUdm4su+M5jP34VzAT73cXVTDE3OBgCKprrqbit8goHdL7E+LQrwP0GtO4hY5yXQ7qj66nDriNsOMppEMaE79olUpUFH/BnrgLxyqum9s4zulCKp2BLjXMKBTsXEvTSrwe77tro8NSiesZ7xXC2JfSLfiQ0JYiMY28b1BUUxWcuKh6JCXQkbBCJgnUUhTy1vqVinReQFLBBCpM+CXyE79pQoU/4sKgE2Cg8162J4bXXpk3B+TbcQMB+lO1kLlcX4V/RuNbaKmBwvguFTyLCieuw83oGixNgKS7z52dzqAa+GcRhxuH/uEHE22HyneHMiF+zMzmWYqM7MinKp5xubnbKe8e2X7Y4boRTMu+PFo491oOyVoAyM4ta+8r50vRrO82yeFg3RMOKyQsBmtQceQlYkOXIpfBiuWd0TcW9QUmmLNb1KHL4wAOXFQ7BrU/UbbK24G+dabCN6DQgazEOIXs4dWUBoV2lqMBhmHw4pzRIWgC0ZUAgZFgTTFPIEce7k2cEJZNv2PtzkhB98= X-MS-TrafficTypeDiagnostic: AS8PR03MB6824: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LB/S7WQYReyYIU5zf0dAJpjtDD7/VRwf42/zV5rgJJHqCnSLiC1NqRzC43x6BJbZF6hyxM/iMgK20dd+1Hez+7SXGE7XBkXM2uG8lcLJqte+jv+3y0ESIF37ZS6fsSJZgNpunH8fTa1LQWMEhAZEO/R5/p2PMRqamr28pZ6c5ZwIx78FFO+Zi+MLmWRGWHgBczT8TO5rUTGH1gBZ1AG4SBE0yL+jAR/lj7MYqawCmV4XtIpIFQlYJVK1KZMLQEzcrACJwAazf9oHlCv/Z5cH4GUJQkNukZvOW+TR9C1zanwf8H3YcAZ2mHQSswfmLB+RrxdGgtVRQrDnHwdMJqEWMJhkfeYHEJTJTAOLCRY7Pn34QyzkRxteXdQRWCzra+YrRd8t9chCfnmQojeq5/JBH8VBLW8/rYcB8kVqnSHm8D2OKEKBSWoQSxZExyXcl195 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rMGeTw9h+Q2cpW1e9ZPv4oaorsNctjIAdhu6vf0IK8tGFM6BfRa+33wpTpm7PrD9t3QABuGwHWsOJar0yJmz+6Rd/YwuKbQbuVviIshMDUtC703g82ZsygE/q3k+TFqpACIjBg+6bcwSA4b7hMDuXw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c6c98e45-e208-431a-37c6-08d96c7ce551 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2021 12:43:13.0617 (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: AS8PR03MB6824 Subject: [FFmpeg-devel] [PATCH v2 03/10] tests/fate-run: Allow to set demuxer for generated file in transcode 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: yFtr9igWFlVY Up until now, the transcode() function allowed (and required) to specify the input format as well as the format of the output format (i.e. the muxer) of the generated file. But for reading the generated file it relied on autodetection/probing. This does not always work, e.g. not for aptx_hd, and so this commit adds an option to specify this. (Notice that one can not just use the name of the muxer, because the corresponding demuxer might have a different name (e.g. mp4-mov).) Signed-off-by: Andreas Rheinhardt --- tests/fate-run.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/fate-run.sh b/tests/fate-run.sh index 4b21bab591..b486c780ab 100755 --- a/tests/fate-run.sh +++ b/tests/fate-run.sh @@ -233,6 +233,8 @@ transcode(){ final_decode=$5 ffprobe_opts=$7 additional_inputs=$8 + demuxer_opts=$9 + test -z "$demuxer_opts" || demuxer_opts="-f $demuxer_opts" encfile="${outdir}/${test}.${enc_fmt}" test "$6" = -keep || cleanfiles="$cleanfiles $encfile" tsrcfile=$(target_path $srcfile) @@ -241,10 +243,10 @@ transcode(){ $ENC_OPTS $enc_opt $FLAGS -f $enc_fmt -y $tencfile || return do_md5sum $encfile echo $(wc -c $encfile) - ffmpeg $DEC_OPTS -i $tencfile $ENC_OPTS $FLAGS $final_decode \ + ffmpeg $demuxer_opts $DEC_OPTS -i $tencfile $ENC_OPTS $FLAGS $final_decode \ -f framecrc - || return test -z $ffprobe_opts || \ - run ffprobe${PROGSUF}${EXECSUF} $ffprobe_opts $tencfile || return + run ffprobe${PROGSUF}${EXECSUF} $demuxer_opts $ffprobe_opts $tencfile || return } stream_remux(){ From patchwork Tue Aug 31 12:42:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 29910 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp4888611iov; Tue, 31 Aug 2021 05:43:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHngA7KQolXP64BmTWpfHK/aLuwPWBVFukpnAz9uelMJOMEcCgKirPCW0E2mqmabMyaJK0 X-Received: by 2002:aa7:d95a:: with SMTP id l26mr29722558eds.305.1630413820697; Tue, 31 Aug 2021 05:43:40 -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 k23si19693774edj.270.2021.08.31.05.43.39; Tue, 31 Aug 2021 05:43:40 -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=BqrXC0G5; 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 B215E68A1F0; Tue, 31 Aug 2021 15:43:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2065.outbound.protection.outlook.com [40.92.90.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E5F0F689A4E for ; Tue, 31 Aug 2021 15:43:18 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bWB2c+jCEOP6nKfiKfWhEhxtAWUxHTgJjHjoxghj9vR9KP1OKp6EY2M3NU62L3bE4nr5QC6FtkmG+xEniV6BdggNtn59wOraYwgg8ZJ1WzfOSe1IUEzLdZDl6USIYD9ftWD7c6czZUnSNVQrG5sGNSE0aDmnu1Sp96B0kzVSVKrGjm8ALngq/Tmrkdd7k5uezlDCfUnfuR4nbYApJsr1VEUxM3rksgzyOydZapzYFKZgpevk7upWF2vzTyEsqJAeVq+2P+PMhSZGvD+yT87aGBzUMNOUPEWnRIGyxFxfAq6HporfVmeiCunw+JuS7hvk3DuEhIIiT71mTPtxsJZRgQ== 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-SenderADCheck; bh=Y+xz0bVpmIR6FmQZoL0NYOdDXXPk7vSMnSLiTF1gCj8=; b=QdKOKM0MR8/3W6DqD0/hf2ZtyBxlWyBjFIsP481RUzDFVmcgZ2jzsRBInYy9/tFcP3uZ8+HbOrRi92xRRdu8Fu/ckVatoMCUqAKZIdllZ1QTFIQhs5+wpdF1gMFkJiDL4UTLM3VIlbdOTXcrS/9P+GBmPMg2Dio0oA85Wt9zaHAc+P6TyDBTLRc0EbanbqGRqWMsmAs8Z1caex/1YZwkPxCto3Fa4SucKzK5eHnP+wu08xqrJtVL0vYM4AXEhkR6bXBmV8SEVHkwrvZNgh6M7gqJ4TSNIG5qOJ3o8KkpbI0OKuxvp7IDyMWkUGej1plxYoR0/zeDzjLxNqshYVOnHQ== 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=Y+xz0bVpmIR6FmQZoL0NYOdDXXPk7vSMnSLiTF1gCj8=; b=BqrXC0G5+4ScrNq0xVqV1ryBkSyAoJoryOb77443vD+O+RYhSZUcg0DkDmyIjFVgCC3Jd4qjbkRYYmF/pYPawF0S8xwT64ExVc+hLZKXRv7dDt8VLpndMRuxKfrlqbV+dxYje/lGJx/59fFEIpcoB1zW4iTYeN90ON6w398+spJM3/TF1ix9AqJDuKG1Z9R9zComgZlMPUGE6tdyRM8UG03EeWEbeYDl4ZYh9RCEZHMdvxkvLXRp/+pK0Ht+hmB77uaqCI14QCxRGH5X/lTwjb0gc+io/Ns8PJwtL1rgaf0zBlEh1L978sEZhrs0C/8SuhSmIcpzD/GvxSA46hzgqw== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AS8PR03MB6824.eurprd03.prod.outlook.com (2603:10a6:20b:29c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.22; Tue, 31 Aug 2021 12:43:18 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5%7]) with mapi id 15.20.4457.024; Tue, 31 Aug 2021 12:43:18 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 31 Aug 2021 14:42:52 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [WOmQKGM0/1tGLU2ZVAWoX2+9/5eI0kyD] X-ClientProxiedBy: AM9P250CA0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:21c::19) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210831124258.1715917-3-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.142.38) by AM9P250CA0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:21c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23 via Frontend Transport; Tue, 31 Aug 2021 12:43:17 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3231d78f-bd25-4528-1f1c-08d96c7ce868 X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNVAewO3OwszBVL1NI+kAPIBbEH7hLwANCt+DjUTkUwN6JeKE3V47kiheX04O0uwHv9UZw7kQH4gyszMEsYCXF9EhmE/3YtkSMATmka2sP/CfbXRKWGkh50JlZnO/uZJLqj6M+rPM+C+kVKR1600Zypn4Kak8EqfXq3qFQH3C4rKV8MR0A4vQBBIOJQUSZN1Avd9hk2olKLTzkYrA1EqvAcJrmkOqgYjm0pZxvz0tf1yiOqAMIKJ5ovjJi2jA1GpRvuJw6iIgTuYEjhoV0il+I/kGGBEyzFnpx/qR6K4jwqktqeSMo0PrCzdF/b9mQmM1+bg9dRztcZsyu9kpQ3tJxtuAYilKmauSyXYBbRSEaxfRNvnUHJ44xaZp3oZOXitVm21X5PyRqdrLY3a9lTr7tYKUTov6tXwuGKzwODJGAawvDpzpnbWPOkAgomgRcHxcTfvvd4uLQ2XmLLmxxptF/zHBvXVfOIR8vfSoWDxUZx5cXcoec8bJNKe4Qk+t36FpKomcBrVyTVpt6Q/YO4v/fl9CbEUI+zpLrkjwj9Ra28daMJWWP+0D/Ycyx3m3d3jPSqC4Hr7nJ/ciok7gWXqfiURMD6gFLJrQJkQyF9w3imUuOY4fCLYQsfWNZ8XI73T+TSIQl0Z4SWo3fraNGet6HUJcvjm3Vmai7Yztg1JTkf0IsQJyQMpUqKobsqJcXwAVfW2KcDrGkoZguVhs6kLj9d/YPdAK7/FqPY= X-MS-TrafficTypeDiagnostic: AS8PR03MB6824: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N58yWxTmTfsaJsPxg1Y6fO1aIYBpVyTGQTfZx2C+m9s6ffzV/lyfyG1xWZtdrfhmIdotmG9QUHWnlTR2rRUSoOQ/VAVyruLrnE4icg7nvBp1Dx5AzENA1M4ceO/KyZxY5UTilBL4coJI+9KmnGz6N3u9oe/1ecYZPhdc6ZN4yaLbtqhNbdjOEAquh/WKskHUVvg5eo9+9R5PRsP1on/CaHd1nobGB6CalEKtrmbhgJJHfA+f12EBeGYwWLs+rhvme6PXn6QvSrVSoxwWsS2k38mACcQFOewfC6I3nmKC8BcajRBG7YJZK6raaqPpm2JCB+futFAvPPyrYnT52WvBb9kcviUvnOSwnNBr7u1D7IheylWmIOPF23LG1FkVtRiTI51jTushJbqQcUPI42wukM+GVFPQZx9MmVx3u+BXNINJWV2i5xcblYv1B6THvoCS X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: K+C+EFgmq/DYx2nmVZdhHoGSdK/i4quS8NUbPk7f3lM2M0L83g/DOQ/lqnLRDRaSvq1XVlEjO+FIeN80/0xRacFz3KH+fsa4/NQ3MXkKK7mmrR6MocHPefKZH0pdW3lmPHwCliJ9P6qxenRPSMhFtg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3231d78f-bd25-4528-1f1c-08d96c7ce868 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2021 12:43:18.2320 (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: AS8PR03MB6824 Subject: [FFmpeg-devel] [PATCH v2 04/10] fate/audio: Add tests for APTX (HD) 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: mkoNLSz569So We have de- and encoders for APTX and APTX HD, yet not FATE tests. This commit therefore adds a transcoding test to utilize them. Furthermore, during creating these tests it turned out that the duration is set incorrectly for APTX HD. This will be fixed in a future commit. (Thanks to Andriy Gelman for finding an issue in an earlier version that used a 192kHz input sample which does not work reliably accross platforms.) Signed-off-by: Andreas Rheinhardt --- The earlier version involved an implicit 192kHz->48kHz resampling which is probably the reason why this test failed on PPC. tests/fate/audio.mak | 14 ++++++++++++++ tests/ref/fate/aptx | 19 +++++++++++++++++++ tests/ref/fate/aptx-hd | 16 ++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 tests/ref/fate/aptx create mode 100644 tests/ref/fate/aptx-hd diff --git a/tests/fate/audio.mak b/tests/fate/audio.mak index fd9905ca0a..a833b99d7b 100644 --- a/tests/fate/audio.mak +++ b/tests/fate/audio.mak @@ -1,3 +1,17 @@ +FATE_SAMPLES_AUDIO-$(call ALLYES, FILE_PROTOCOL WAV_DEMUXER PCM_S16LE_DECODER \ + ARESAMPLE_FILTER APTX_ENCODER APTX_MUXER \ + APTX_DEMUXER APTX_DECODER PCM_S16LE_ENCODER \ + FRAMECRC_MUXER PIPE_PROTOCOL) \ + += fate-aptx +fate-aptx: CMD = transcode wav $(TARGET_SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav aptx "-af aresample -c aptx" "-af aresample -c:a pcm_s16le -t 0.25" "" "" "" "aptx -sample_rate 44100" + +FATE_SAMPLES_AUDIO-$(call ALLYES, FILE_PROTOCOL WAV_DEMUXER PCM_S16LE_DECODER \ + ARESAMPLE_FILTER APTX_HD_ENCODER \ + APTX_HD_MUXER APTX_HD_DEMUXER APTX_HD_DECODER \ + PCM_S32LE_ENCODER FRAMECRC_MUXER PIPE_PROTOCOL) \ + += fate-aptx-hd +fate-aptx-hd: CMD = transcode wav $(TARGET_SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav aptx_hd "-af aresample -c aptx_hd" "-af aresample -c:a pcm_s32le -t 0.25" "" "" "" "aptx_hd -sample_rate 44100" + FATE_BINKAUDIO-$(call DEMDEC, BINK, BINKAUDIO_DCT) += fate-binkaudio-dct fate-binkaudio-dct: CMD = pcm -i $(TARGET_SAMPLES)/bink/binkaudio_dct.bik fate-binkaudio-dct: REF = $(SAMPLES)/bink/binkaudio_dct.pcm diff --git a/tests/ref/fate/aptx b/tests/ref/fate/aptx new file mode 100644 index 0000000000..22607e2b89 --- /dev/null +++ b/tests/ref/fate/aptx @@ -0,0 +1,19 @@ +b5d8a297c0e8d9854f19d9d3e8b82859 *tests/data/fate/aptx.aptx +418950 tests/data/fate/aptx.aptx +#tb 0: 1/44100 +#media_type 0: audio +#codec_id 0: pcm_s16le +#sample_rate 0: 44100 +#channel_layout 0: 3 +#channel_layout_name 0: stereo +0, 0, 0, 1024, 4096, 0xcbb4ceff +0, 1024, 1024, 1024, 4096, 0xa66533e7 +0, 2048, 2048, 1024, 4096, 0x4f22ec39 +0, 3072, 3072, 1024, 4096, 0x45f117f9 +0, 4096, 4096, 1024, 4096, 0xad6c0b7a +0, 5120, 5120, 1024, 4096, 0x611618fd +0, 6144, 6144, 1024, 4096, 0x0ec02f2b +0, 7168, 7168, 1024, 4096, 0x2cf9ae5c +0, 8192, 8192, 1024, 4096, 0xfb008ac0 +0, 9216, 9216, 1024, 4096, 0x25068495 +0, 10240, 10240, 785, 3140, 0x5a260589 diff --git a/tests/ref/fate/aptx-hd b/tests/ref/fate/aptx-hd new file mode 100644 index 0000000000..f0cd72ee90 --- /dev/null +++ b/tests/ref/fate/aptx-hd @@ -0,0 +1,16 @@ +48ecaa81ee5adaaa62ed3ff6574b6666 *tests/data/fate/aptx-hd.aptx_hd +628425 tests/data/fate/aptx-hd.aptx_hd +#tb 0: 1/44100 +#media_type 0: audio +#codec_id 0: pcm_s32le +#sample_rate 0: 44100 +#channel_layout 0: 3 +#channel_layout_name 0: stereo +0, 0, 0, 1024, 8192, 0xa99888c6 +0, 1536, 1536, 1024, 8192, 0xc3e03a3c +0, 3072, 3072, 1024, 8192, 0x3f06e090 +0, 4608, 4608, 1024, 8192, 0x92fb18f3 +0, 6144, 6144, 1024, 8192, 0x3d5603a2 +0, 7680, 7680, 1024, 8192, 0xcc3d3101 +0, 9216, 9216, 1024, 8192, 0xbcc022ef +0, 10752, 10752, 273, 2184, 0x9873af57 From patchwork Tue Aug 31 12:42:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 29913 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp4888714iov; Tue, 31 Aug 2021 05:43:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcykhfR41ITxqX5ApQjiNO1wfCcZ3jIgS9KmroNJd7oZc69rgBYyP9ZT3EWYDWBThrWsCj X-Received: by 2002:a17:906:39d5:: with SMTP id i21mr30657233eje.529.1630413830659; Tue, 31 Aug 2021 05:43:50 -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 e18si6575015edj.207.2021.08.31.05.43.50; Tue, 31 Aug 2021 05:43:50 -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=nHaq2bLT; 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 D9E6568A2BD; Tue, 31 Aug 2021 15:43:28 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-oln040092073025.outbound.protection.outlook.com [40.92.73.25]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BADE968A2BD for ; Tue, 31 Aug 2021 15:43:20 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mHP7obKil/xn9jbaMo1EnU7JWHInmTMjyODhtDMrNTAcMeQ49B8arues4bwA9iQNW3Cbn2hs5aCtVKcRig7mvufLedjlizmz0nwtA46SXHXt/u38LQC6HWCK00+e/ku2Urvsiw5y7Gue499ghUl/W1GFUh8WYZRFfkUQL/M2CV3bMQUIjxj9nkmJBlNHehROp8WX7yqfoWLvkMpFc7BMx2BybfXwTV6s4XecTAd03Wa39/ETGDeQhMTbUb1sCUO7mpWjAppZv/975XAzLmwW4DZs7eHcHIWXbRYv92FBugSkoQ+hV4Uk6/ezQf5VTOIZ+q53XN4pAecjlCJPgcWo7g== 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-SenderADCheck; bh=eaCiy9bza/L2jqziwGoer5CO9mlp22rC8q19tLZABYA=; b=YptGE9cunNOrdLuc5GHvVgQD5S5MIhNH4xtzyZBK7N1s7XVptbFMJtW+EtROvN7iRgBG4dTf3TrMZ/gGyRIC2aOYwJcIcP6PmBqw2dNUeUZ40gGC/PyrIAgWgxDBJMQctBy5Jl5tkq+ach390nDuwsu718cyOgjkdXnJRaWa+a4NsB+M4aLcM35T6p+Lcwoiv1MUD8QVHumbNeCeMKG4bS8uXgaMzxjyB1U7I/q7HoNn0RhUmQIcMnAJl3rpMENPIs8nW6XBZJXhzQ6lhdsG0480RQu14QdCeRNF3K1X2td10xe17ctmpu4pPZGhtfnztu1FIRvAeEnm+IzguN549g== 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=eaCiy9bza/L2jqziwGoer5CO9mlp22rC8q19tLZABYA=; b=nHaq2bLTbgmI9PDbbWEOgrIVZXyf2S0JLGhSL0VuF22iVQGAcmEQSnMrfEUPXmYSANL3oAdEcIoKyRdRFlBQALHqfXY21ax7fz03LDAxvqDBsNyiIwHMtt9hqwxwRnTOW1+EC9QubFWU2DN6ea+WMHLp0eor3xGH6cgK/vccU44/RNB1EfoNJQDQOMqv0vYpMxryxH0EqKFkkobYbzkUxShIHkFyU4aBeZfjbc2Wthl5CZkOMJy1CIFWaF0l37IYMtxjAiRaP6j6wYLMKVQyiVV3aRWwfQ9vII9oEgGkEYWjI2Ag8DbdX3dbpctuZlXrHaJevlH3dL3JxXj2T97zJQ== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (10.141.218.86) by AS8PR03MB7270.eurprd03.prod.outlook.com (20.183.133.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Tue, 31 Aug 2021 12:43:19 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5%7]) with mapi id 15.20.4457.024; Tue, 31 Aug 2021 12:43:19 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 31 Aug 2021 14:42:53 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [CWZ5J2LhiTWikjn3lB7riwxbjLQpxGkC] X-ClientProxiedBy: AM9P250CA0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:21c::19) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210831124258.1715917-4-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.142.38) by AM9P250CA0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:21c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23 via Frontend Transport; Tue, 31 Aug 2021 12:43:19 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d2252d05-9801-4e3d-b92a-08d96c7ce93d X-MS-Exchange-SLBlob-MailProps: +LiGfBxqLEvWcunD+UIW0Hguvzll3NV2vhXjSUy55EWYHT/Pl5HEPS76umKcjhMxTS6OMFNNNmUw5hLV9SbdgKWCBnZi4HC+JF/i3T8G/y0oM1rrTopXALWsKoH3Vic1eNa6TwEZVsOrWI/MW6lrE9fcUaOiyh86DX9ssFfS9/wAKDReUaBJgHrEXeB4NIY4gGmCwWvx+ZwQS3u19awhqK5LCyszmFp8hpricXpE3+xW5+mi8bsoG5Z0v+DtD6C2EWdTqjr+f07kyhU1JDCT/bK7V9++icjSdvBT9sJPQssrovifglciFmsi0SqR804edhwSX1y1vwvoRD89PAobjQtMUwJAhIw6/uEK7jESH2UYBDEvh+Z4ApdpDBU5T7KU2pwDRcl/lvyzTGrt6PYwYga6aSNANWGuVwiszCDuc4MB3BBqbbM35dm768pe3eOzWXheheBy9FzRNR9rZ1KqQ6hJCBZclghbm5+Yd9oBqYqV1aePdxIEwztgHLTA17ZP9ZItfuZoG9M/b/oqohAcvQdZh0K6XmIfEiwuOJd3byEqNIix0xmlustCNCsha5pY2RyAlDYh0bNBzo0qw0GxlU5R/Fx2hFDSkZYBQU9QGSPWbgayBVd41RPQU9Iv0PVpLlR07hICKMyv91oeqUKKdDZaHDP5nSY067kqTc7MvvXjGUx6r3lOoZ8/YtCFcvsyD5HDoXrXZoaLJq7Cxt3MfQz2IIErX54sSlh4yQe87wJTBI0XgDmXQQHwreAJOllfEF8pjPpGOZw7H2ttiKLy2CowzJ0xPEjT X-MS-TrafficTypeDiagnostic: AS8PR03MB7270: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: n4FNRwBbLRC3O0V7YRsBOa4UxviZsu/AHetoYAeCsc+/on2xo51gcy28R/A1Dk9IPnhvQ31tS5fQi6eakedsLrkefPniUvcrBxgJqOCAOQ18F5+294J6Fqvc2oFbk9yneM4xJJ4DkUnJiHh2Kr2CNblQV4XBjbFj9Pnus4TarXEBF4Q190roe9aFNj5jKOjtWmewt6x/kVKycsBaDh8/7dztcexAWbugY9gpKoMEID1je0EjEp3PdkPQmWUDpgE+7Wsj7ygz/gwJaNWXZOWYlOFMCiT8B6GjzPbu/F3rUB5LXLIXDdZCY9Y3XoL+92Sfz/iqsc69vvh8jzX4+yRE/kRuZ3j0nq1oajQa529P19/FZQCOQqipu1jiPyJLfpQGd3NcTuP3k1WxckCmyDJYTRqEScOllj3+Y0s0oOBK8Zoeoprgeab1J36XrGrf0giD X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gqMjvAxtBdgNC61oBGzkl1acFU2IMhlu9Z8DnyIeODbHN6zU96xiUBJPjB2HC4WkS2078hv7jYJhPiGaovmhT4xLukeypwHVLF0+S+BMv4/74HGOWM390P7jgtEqqzjlD775p/lVL3SMQzviKEzbSw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2252d05-9801-4e3d-b92a-08d96c7ce93d X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2021 12:43:19.6358 (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: AS8PR03MB7270 Subject: [FFmpeg-devel] [PATCH v2 05/10] avcodec/utils: Support APTX (HD) in av_get_audio_frame_duration() 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: evdfFy8rJ73K APTX decodes four bytes of input to four stereo samples; APTX HD does the same with six bytes of input. So it can be easily supported in av_get_audio_frame_duration(). This fixes invalid durations and (derived) timestamps of demuxed APTX HD packets and therefore fixed the timestamp in the aptx-hd FATE test. Signed-off-by: Andreas Rheinhardt --- libavcodec/utils.c | 4 ++++ tests/ref/fate/aptx-hd | 17 ++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index cfc07cbcb8..9090638385 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -678,6 +678,10 @@ static int get_audio_frame_duration(enum AVCodecID id, int sr, int ch, int ba, return 256 * (frame_bytes / 64); if (id == AV_CODEC_ID_RA_144) return 160 * (frame_bytes / 20); + if (id == AV_CODEC_ID_APTX) + return 4 * (frame_bytes / 4); + if (id == AV_CODEC_ID_APTX_HD) + return 4 * (frame_bytes / 6); if (bps > 0) { /* calc from frame_bytes and bits_per_coded_sample */ diff --git a/tests/ref/fate/aptx-hd b/tests/ref/fate/aptx-hd index f0cd72ee90..8b62ea1611 100644 --- a/tests/ref/fate/aptx-hd +++ b/tests/ref/fate/aptx-hd @@ -7,10 +7,13 @@ #channel_layout 0: 3 #channel_layout_name 0: stereo 0, 0, 0, 1024, 8192, 0xa99888c6 -0, 1536, 1536, 1024, 8192, 0xc3e03a3c -0, 3072, 3072, 1024, 8192, 0x3f06e090 -0, 4608, 4608, 1024, 8192, 0x92fb18f3 -0, 6144, 6144, 1024, 8192, 0x3d5603a2 -0, 7680, 7680, 1024, 8192, 0xcc3d3101 -0, 9216, 9216, 1024, 8192, 0xbcc022ef -0, 10752, 10752, 273, 2184, 0x9873af57 +0, 1024, 1024, 1024, 8192, 0xc3e03a3c +0, 2048, 2048, 1024, 8192, 0x3f06e090 +0, 3072, 3072, 1024, 8192, 0x92fb18f3 +0, 4096, 4096, 1024, 8192, 0x3d5603a2 +0, 5120, 5120, 1024, 8192, 0xcc3d3101 +0, 6144, 6144, 1024, 8192, 0xbcc022ef +0, 7168, 7168, 1024, 8192, 0x600cbb73 +0, 8192, 8192, 1024, 8192, 0xdc938cbb +0, 9216, 9216, 1024, 8192, 0x37d968bc +0, 10240, 10240, 785, 6280, 0x48243144 From patchwork Tue Aug 31 12:42:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 29916 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp4888807iov; Tue, 31 Aug 2021 05:44:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSZmtrl5eX+iRkNGObKmWzi6mGMvP+o2sfW+2FNohpEVfVKuqpL12zDZ+0aBGoHtR0MM/t X-Received: by 2002:a17:907:2a51:: with SMTP id fe17mr30923688ejc.179.1630413840498; Tue, 31 Aug 2021 05:44:00 -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 w11si22675429ede.300.2021.08.31.05.44.00; Tue, 31 Aug 2021 05:44:00 -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=e1YYmjwW; 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 001C668A0B6; Tue, 31 Aug 2021 15:43:32 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-oln040092073086.outbound.protection.outlook.com [40.92.73.86]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6B85768A306 for ; Tue, 31 Aug 2021 15:43:25 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FANHPjLGAXp3PlyPvkUFx2KBMWuPy5xPPf7zFC6P4P2vAkyOzNeMUapOPfBCFH6X7LZG5wUDHUXiji6VTJMNdamLflU8geYGX66ElBq6LUP2OZ6t2wlxpxI6KrTO1/SDgpZcljjEPvFvyGNi4/nsiN/0y7i4pBrHDGlDEP9RJhlA0BRD9+AGhtyfKINqm+Oij+/lT4TSnY5yTqK/FLiFKjyI3kICwj69V/w251ObJrCJm2th0HGcjnIYTkZbXSaHjAJewzcV+2kghTHdUJRM/ti7w6AsAliKkYS/BoudME/Q0Fud4FZK/58hePnbmx1nPG4Yh7UoCh3bCSVAxtO9DQ== 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-SenderADCheck; bh=F16WiVY7aTY/15Pd8kcqCt5dl1NfbxKmltE9oyfnk8s=; b=UUhxpjItrY/eQdRatu2JvWea3QwYKE+eXrP+4j7FpedBiAPlMAutfp23oORRi2kSEgFenIjqMVUBii0a6gu+uYEm2UFtR+6jn+aFZFlaq1mA+U5+1QnWLryKQwAzQoFEPTDYALSSd8lS7oxdIq6KfLHz98pWZ1rRkwy3bsqRNB75HIzSe1Fvajw3oFrikCsCBH/M95aLv9KESy6AC5XYRL9MPTingoDsAkmClSwP8ixd/iyp39RG3JcjVFVttan72M0k1dNztwrci2RLjQZqKCicys9DvZI3nqy1yoBzDAvl+ymW4e7UBYzgHRQ72g2emK6gkKhy/EoHaSuA5h0GAA== 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=F16WiVY7aTY/15Pd8kcqCt5dl1NfbxKmltE9oyfnk8s=; b=e1YYmjwWSKzNm6mWBVOJ8IRUQNjVuJT0QCCQtFiodsVKzo3qo2zJLAQMeaXjEvD/IRD+mXEC9JMbjvtPTAiGJ4GqWBt09EKO+kCq7i6sauRG0AAViGiAfOZN/wi7WDAf59gkYiX0JXYMWNyrapBihp5NNaKCd/fOn0N69pkg79K8XvHpogbrO5CKEd00RnsZ9Q6iRCGsqXsQZ1zIlsO4DRxknH3A9zoji3Jr607ulT6uTEye8GnGwONhrRuX4h5dDSuRyTmD9l8H8LktrcSIyPgwGTUusaZWXJ8ML+KtnlVh6JL80rldxG0BIwa9tZqjRSNYiudU0Qy0GKUpDOHbJA== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (10.141.218.86) by AS8PR03MB7270.eurprd03.prod.outlook.com (20.183.133.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Tue, 31 Aug 2021 12:43:20 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5%7]) with mapi id 15.20.4457.024; Tue, 31 Aug 2021 12:43:20 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 31 Aug 2021 14:42:54 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [xg9ft7cVc5slsdzIYvdYLnGnxdBndPI+] X-ClientProxiedBy: AM9P250CA0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:21c::19) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210831124258.1715917-5-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.142.38) by AM9P250CA0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:21c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23 via Frontend Transport; Tue, 31 Aug 2021 12:43:19 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4c253091-6fc8-48f1-6dbd-08d96c7ce979 X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNVAewO3OwszBVL1NI+kAPIBUpQReh63EVB7Yv5FiIEU5qNGBAmcszmEwra4GI8BpegD1mHEZ81gtO2Okt3OU0AIQ0+3NkasmCBTc3V4/KJ4CeXpcGuNF+FxFfLqGfy3jqXP/ReKsi5kaseunPUWhDxm0FWTj+GL9uAlJ1TxjWz73i0/L9fMk/oEIoDHh7dQqDiDmlfZLm/XPZzlIZpv+dyZwXzcFr7ihEjJ3qrDp8VpVndAVkRFv5uT+bQW23joyIAyDnW3w6iHQTkwJjOofFaZoU/Wr4Lli3StAOEJsBFKWaD8wLZLiNI4LmHI1pPj/ewE5ukZlJZtJsjEvwE68nL8TVQ1okRt/UztDz8lTMucm9rAVgYlH+C8mt+TTrTqm33hQgsa0tkJmx9YMLhg6/iguIMeqw/vRkRPy/MDO4QTJS2VY0SBn8VWW2ATiOQKDOLHr2g2wkjrBzVrCFLji9B4naRCJyrQIjkJl9OqKt0vKftiR5Gt9UluetMF0lAIjpczrGg8vtsZ+VR1f4Eb0TDm1qaBDi6FaFxoFqogdiVEu6VbA7YLGQ4HGAVxV/FkZdRZT7e2YtB8/hCt3mnz/ttm/23itjQjIDmI12ZJq55ktbR1Wu9d3+m0PDFRjf5fkNmB6C8vL7lG8QOKKdQiol6RvCirqlHYlINnwx5cGPwVOt7fKTr/IQEHOsDCeRZaQ6CseyAOdFmRxTF+mtK0ZOwWFRXY+W5WMXY= X-MS-TrafficTypeDiagnostic: AS8PR03MB7270: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Pwz79bIF24hK4ww0LwRmXCE0txRzufB+mkRSDy4oQW9Dupq1DbZtQBxNVaNuk9pgfNdwziLZwrrSK2SLWy/q3JOrjoHQfMz1hN9SIX5yEfh1YHc0v2X4AvYAL+WrmotXnqoqTw5oEkUihwSksfeanziESE5DnTpFgZByOebNKMJ1MfZy8vAgOVMopnbdHm+JIJ/xuVSbzgcfZlk73/Vwx6M028veUhz4S3v3XHcq4f2ThSi3ItrfYlPWxSBG20ht+MejlPQFiuNGQuoi1sSb14YqpzjkkPNSNJoxSHTBWOCK2MmxLnd3X5/Vmy3xUx7sd70NAfEfc6CMl7kjwauTpcjgPBSdSC2ScC4K9szmc/F+azsXAWDGGlf/10i1GOMq6YQphtCRYzglFhEezVlFU/8VjwaMen9cC2cU1RAOJCyK8MZIOD5cMybdh98yfv/o X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: G1hPluZHXg7VsteSiuTH2ZLbbllG6yY8ctadN39qFzYu5JV4l1DD0kLTCZ8EmXF1qbHOn7mHIqSGAQ5J/0fW0ZaG4hngszR0hkT+zCVhgRnYas4arQAnKHGMqkBV5dC3q5KG0B4oJt7dy6FMyRDYOA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c253091-6fc8-48f1-6dbd-08d96c7ce979 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2021 12:43:20.0420 (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: AS8PR03MB7270 Subject: [FFmpeg-devel] [PATCH v2 06/10] avcodec/aptx: Use AVCodecContext.frame_size according to the API 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: RD18xY9T9S76 Currently the APTX (HD) codecs set frame_size if unset and check whether it is divisible by block_size (corresponding to block_align as used by other codecs). But this is based upon a misunderstanding of the API: frame_size is not in bytes, but in samples.* Said value is also not intended to be set by the user at all, but set by encoders and (possibly) decoders if the number of channels in a frame is constant. The latter condition is not fulfilled here, so only set it for encoders to the value that it already had for APTX: 1024 samples (per channel). *: If it were needed to check said value, one would need to check for it to be divisible by four (four samples correspond to one block of block_size bytes). Signed-off-by: Andreas Rheinhardt --- libavcodec/aptx.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/libavcodec/aptx.c b/libavcodec/aptx.c index 3aeee1907c..97397aca68 100644 --- a/libavcodec/aptx.c +++ b/libavcodec/aptx.c @@ -515,14 +515,8 @@ av_cold int ff_aptx_init(AVCodecContext *avctx) s->hd = avctx->codec->id == AV_CODEC_ID_APTX_HD; s->block_size = s->hd ? 6 : 4; - if (avctx->frame_size == 0) - avctx->frame_size = 256 * s->block_size; - - if (avctx->frame_size % s->block_size) { - av_log(avctx, AV_LOG_ERROR, - "Frame size must be a multiple of %d samples\n", s->block_size); - return AVERROR(EINVAL); - } + if (av_codec_is_encoder(avctx->codec)) + avctx->frame_size = 1024; for (chan = 0; chan < NB_CHANNELS; chan++) { Channel *channel = &s->channels[chan]; From patchwork Tue Aug 31 12:42:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 29908 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp4889115iov; Tue, 31 Aug 2021 05:44:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbnB4+Hk/0bfKyPoEZYwTgRbi2t0YpTYPoQ9H3+G6RLunnCyTEafnqnSiJi3spR6pmM92B X-Received: by 2002:a17:906:3e10:: with SMTP id k16mr31768363eji.116.1630413871286; Tue, 31 Aug 2021 05:44:31 -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 z16si17207095edm.532.2021.08.31.05.44.30; Tue, 31 Aug 2021 05:44:31 -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=WZQ59fGa; 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 1C50668A3AF; Tue, 31 Aug 2021 15:43:36 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-oln040092073025.outbound.protection.outlook.com [40.92.73.25]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E071B68A306 for ; Tue, 31 Aug 2021 15:43:25 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UgQz4APp2dNOLSrLawSc7FOXIQox3ACSAb6l+CO7ncAPG0PPvYHu/R6W338W9OqSl94zZ2lWTabSqIwJ++51rUxFRFOr/sTwe/4MITL39E/vpxibJZSJ5XAZQ7kzSvkthIQ/vbxY0SDsiaUlm6wsLIdLvSEvZyZr6CRZutk41La4Of2OoyCKuQK698KcX6bzzxJwpXQLNroN3XFXYoYa0U2FI20qFqiTnC50/tl9jpVvrC6dip0blJzOrEIqBBEYcBfU/uBxleQKxsGfEYCa2J+B/FOSxDrVvqCHjOX+yKYCAq3KtI6urlEpwTmyTmogneGmIK+A2mkHbU3QuiANMQ== 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-SenderADCheck; bh=Y6mCSztGra3nfl1T9gg1Z0eN4ObITbcTX47rG/m1/6A=; b=oTB8iqZ2yiwGri3TvikTs31jTidOlj7hz15LR6Ck80K2DIDKT9K3nW/RbXO7VTsw49EsOvcKDk/n7jLP/DaVXHRrRYFD8uep1YJh6u7j9ijYBhxVtQy10C3c5UsbbAhx1jHc9adTyNX8Z9FI62QU+gvOoZkkfL68UlcUz/3mkqWpqsbeAzX7XBhpy7jxrX7xqZYvbbDfML/nap0caUBiXcc93PxPC8EoX/ivffHTdnzUIFBVn+LxQFSIclqprO2o8GJqlrzwTgN9hBu/s133wzCFgUT3pURRjnVPFXe8zMu5uYKJGdWEWAOfhJyM63hRPptKknxgiqS0ana9WMZRTw== 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=Y6mCSztGra3nfl1T9gg1Z0eN4ObITbcTX47rG/m1/6A=; b=WZQ59fGaZV+tleaZh+jVEtoC7UULFpMycsWcreft9e54NUZMBpZXuGFlEnxv88Pl+PHRlR6HZmkV7fBcFkOJyxoh7X64v7ZsCpQHnSm1KNmJ4C/eEgKgpABosvbQ1I6r76VkRFmOLpKhrv9DwKeSGhPxH+69n/2YAuhwBIRiIuVH2kspUTJr+VrEwgkgmP/UpIBno1fvw68DFGodLULVuwGUPChndmSm+y7gnrgoVOXPIJBHcB8dY2nE9ANzKt69KXZCHZntpSAhf3EQCUjAr1TMJsQfsEfQMLMBLplpxYyNx7zpxPqyIgipqFYbHT4sH8ykkpMYLW4GCc8EZigTRg== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (10.141.218.86) by AS8PR03MB7270.eurprd03.prod.outlook.com (20.183.133.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Tue, 31 Aug 2021 12:43:20 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5%7]) with mapi id 15.20.4457.024; Tue, 31 Aug 2021 12:43:20 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 31 Aug 2021 14:42:55 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [BCUHQ4CHtN/i2xtijK1zDUV8zsiTASLA] X-ClientProxiedBy: AM9P250CA0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:21c::19) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210831124258.1715917-6-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.142.38) by AM9P250CA0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:21c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23 via Frontend Transport; Tue, 31 Aug 2021 12:43:20 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5a96451d-57f9-491d-5fda-08d96c7ce9b4 X-MS-Exchange-SLBlob-MailProps: +LiGfBxqLEvWcunD+UIW0Hguvzll3NV2+rVdj2ITRMwU56uuF9AeArufp8UTc8m6BS37H24RLJif+wKpxN8gVL4D8LXepUPMZ4oA4MitbhCiRjkGYjYUkz7ezy4TWcu4v+wHsIOUlGSlmUEuGfklqpHN0oVSRIBpcES/VHDDqejLHPHP7TT//4uGwYmmUxZOIxd8FnzmIZcO7T4E60CfjMhD2MVNLpY8bmKDIWIhQoW2/ZHpneGQOoMWaI7Dno/s08DkbU4uK1TpZVRHXllUnN+iEoWb0DPNcrROqRBscl69oFGSOScUcQU6kYpR6jKYqZbdh+7ukTcKWThkYqYp+64i3PRjPsD4+ySISqQ8aedvRP3xCljvCX2B8wkFCiMKPOQ9kywkk2on04MoMjCHsCOKf5GEntcQAUSv01l182paTxpCIF3i0rJiJpG3WSx6vHnez4/jANB7scFTnd3/ANcu1CjtzWpmMFGQO7dYv7XT9DdvNSm7vPt696852PkFBvNXFwmVUR8YEkoRGFR+s7UbuiRuhJ7JmyGu2dn2eWdZPWeMuGTnScvfGN3uV++GxJSbJqVvAcCNklpiSDZBJS0j+xMuDX2zX72u4DBosd334po5UQVprZufPAs+Q67x+hs8Ette5AqJF89NsMeuy0azb8a3E9HrXmkDS1ruPynbgeeW3hR2MRUF7lgFxx0KnqzQOI7ll+MfaTE6J2ZHzL31FZxOJvZn6r/NBrMepJ5MXOvndVHGmiRDwSfJT/aipa0mnJzOpw0yMYzEXDb0rKCLi6JzBS9g X-MS-TrafficTypeDiagnostic: AS8PR03MB7270: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kt/fp4V6wgRrTQYJN/nMYLny6qdF0jtev11u/L23+Edk5q2yPqqply5/14LVNRtMtGt2TobYK6OiqBGx6cmT/S8wea+GlDKxtXvvEDGBHY9B6WyxfrTF6Evp5d7X7ACja39FL4DqpG2k5noPiuF+OhOedUVxNZESSodaurTg/HzF65L//RGaLAPBjJSTRVfdHEVLcBhcNx5XdVHmiITECE18y4nWnhjmGZJSeqapUoQMY/M9Bf3HZ33oN2QE52AQRoH4GXU7s563y1nJuXWvjotHKW2jk+O552EtzUMRtWMQNvXnp/Muwg7WUs+VlpWPNPNDQL6I6fowTHTF/Qdn4vf9TdE/YG/i5UtiWJ6f6NPpUFj8p3jF5AjE8BscbGL0tQ8viZ9ft0GkOTd5/LrFyy1pDhm51odCOyg1HSVHqCyByIB2tWZbXLt2YxMEANdw X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rznaEdV19DS3iWX8P20emB1GhkigLvnqO9yjOTdW0Ue5dhUbwhTDegUdZG4+j2Xft84UiJgjAFL5q4uNNailHU/nuspFZKECMpJiMmp8f3F25t09R9UXBK+kNG/JVPNnX35lyk8+dqY6RwV0g/JgqA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5a96451d-57f9-491d-5fda-08d96c7ce9b4 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2021 12:43:20.4064 (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: AS8PR03MB7270 Subject: [FFmpeg-devel] [PATCH v2 07/10] avformat/aptxdec: Don't set AVCodecParameters.frame_size 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: evH2zFDuPi5O This field was misunderstood: It gives the number of samples in a packet, not the number of bytes. Its usage was wrong for APTX HD. Signed-off-by: Andreas Rheinhardt --- libavformat/aptxdec.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavformat/aptxdec.c b/libavformat/aptxdec.c index 7153e262a1..a5ed921e2c 100644 --- a/libavformat/aptxdec.c +++ b/libavformat/aptxdec.c @@ -56,7 +56,6 @@ static int aptx_read_header(AVFormatContext *s) st->codecpar->codec_id = AV_CODEC_ID_APTX; st->codecpar->bits_per_coded_sample = 4; st->codecpar->block_align = APTX_BLOCK_SIZE; - st->codecpar->frame_size = APTX_PACKET_SIZE; return 0; } @@ -68,7 +67,6 @@ static int aptx_hd_read_header(AVFormatContext *s) st->codecpar->codec_id = AV_CODEC_ID_APTX_HD; st->codecpar->bits_per_coded_sample = 6; st->codecpar->block_align = APTX_HD_BLOCK_SIZE; - st->codecpar->frame_size = APTX_HD_PACKET_SIZE; return 0; } From patchwork Tue Aug 31 12:42:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 29914 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp4888920iov; Tue, 31 Aug 2021 05:44:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2b7Zt3KLXS1Bbob4H/9u2t6iG0Fbo4SPR0DkEMATTqdZLc9ac08hrkwVD98LGO1V9C6xd X-Received: by 2002:aa7:de85:: with SMTP id j5mr29472019edv.147.1630413850011; Tue, 31 Aug 2021 05:44:10 -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 a1si11064051edx.506.2021.08.31.05.44.09; Tue, 31 Aug 2021 05:44:10 -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=Vkh6rzga; 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 11B8568A473; Tue, 31 Aug 2021 15:43:34 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-oln040092073086.outbound.protection.outlook.com [40.92.73.86]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A02A168A306 for ; Tue, 31 Aug 2021 15:43:30 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F3frwg4MwMhYIi9RxgpJVEPkTdR3Gam6cwK8X5ELeCvfiXCqwDj180s+YcTXCmKfSLKHZEAozZvplys+SP+7Lfbk4QBPIpDkvN/Ehdx9Go4YI8yBLnsfGEC990SiEaGMPrhVXD5US/DNNkxSewH6gtv85flTNPNshfA1lAF4IVEXMjptiKO1W6o379wvAFAxyEujMv26r1L09XXA0XAKADYYreaMOslnycBr3B4+lyY3ksRBPGNMzBQvrwy+8TR3Jwb2qs1bI59/W4EnILlimY1FMyWgcF91+L0dD7K6Sj02RTXRDpXfvw6wVWhUusOsHhrvYLWdxp+HrqYTaxQwoQ== 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-SenderADCheck; bh=1frG/HO//MzrvnwN2MZ/6iMVZyF12dGC4C2/pNMGjfM=; b=KYb2mxdSCIg6t4ICgNTaGVRirjFSrPuGIBrcxqyqXSI1Tp0rGVJDOCwfUYr4rr9oRKW8O0gEbzB7l6K6EqOdjXFrrOp9Jdbr+QZuHt90puN6keNuI45bZLatoKwta9AyKuHrxDyc4l16XaLvuU6RVt7kuOQnK0iuq2J0rEBtAxltMC54KBPl6rnbHwNStVmmRqc9uG39AzTDkFqiA0hAIvan3Q/D21aJF7KNbnu7EPiRHm2pLNE/dU29v7l2P8mIrhVbuzNQB46T8mIv7EP3Zpi6cSAnWhPYytbOPlzbstB217EQIbiGEogZZHyAtORQVpHDgMIpYfl9wydhPEe8VA== 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=1frG/HO//MzrvnwN2MZ/6iMVZyF12dGC4C2/pNMGjfM=; b=Vkh6rzgatChOW2ZPO0fA+hL6K21EigzJ/MA9N3d7M/BcjtUOwpOnMu/Eil3ISPOAKTEwM4lH7jNAM09B1ada/m1NrSYKsO0hqeM7/RfHqnMhgpJzAdka/HfrhZAehNv5Dy/Nnp3SdFfJO/ssgkIb94Rf+9bKY6PqplRmr2qPgfMKmvJhqB3ipgsP7kUsU2az8rznNueOKlq5cHxV69WPF8nw2QdQuDVJoZxatqBYo9SBfIvc8Z+f7kJmV1sTFf/0BQvXIDjIp6xjniNlLyr7u17gARugfocZn4VNWuCZb9Je8J9Jg17k0G7ItQ44qjnpIH2eJoY2RRvpgoQYTAsWsg== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (10.141.218.86) by AS8PR03MB7270.eurprd03.prod.outlook.com (20.183.133.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Tue, 31 Aug 2021 12:43:20 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5%7]) with mapi id 15.20.4457.024; Tue, 31 Aug 2021 12:43:20 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 31 Aug 2021 14:42:56 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [UP9B+liNU6+QrMkA474P2DrQOPK/seNi] X-ClientProxiedBy: AM9P250CA0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:21c::19) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210831124258.1715917-7-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.142.38) by AM9P250CA0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:21c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23 via Frontend Transport; Tue, 31 Aug 2021 12:43:20 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0887d64e-bc8f-4450-ed6b-08d96c7ce9ef X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNVAewO3OwszBVL1NI+kAPIBwte81gPa6nTNLFzZDeuJXcJTyRvme2PhAMTC0A6XNfdyFyZclrWKlxcPynBMiSkCEFj+a3/tPAWCU9b06lY2fhWEX/dvl+dVJDG6DbVol45LW6DJvDfObFrvSqQF7PWwOyxTfternYBXJlgiiB+rQE4W4/MlDnSvRp+aQAmN4+h1kqrDB2amek1+axdcZV79rfKomT3dJbXKkyT0SGd/CQ7y5jhU2IOM+4HVgoPSBCjNtjVOzWv3HvCEkfTs5GAKqAivFMEdInMbCOy/4W08vIf0A2AcvyyY1yze4scjOTvNz0FmXppRnm46SV/z3JD+m5MqBhhdzlpk4Eu92J940Ivdog/ZxCAnSXce0rmzZlooyIHDymHr/Ny/hsMAOeJOC7yXow9PYA5b70HN6S86XK+x8/odXC4QYE5Uy9lnTiMAOFIzto88BpCqoTJsrsD+TSyl9NmAvh1rh1c2GnoZ6UwXo1rTMnhAAiyQrzyUUERMOjeHKhA+wC57rNzginzVXg5FKuHPn2vaFAr0EilpdWDG7ErUNQatCTG+zocjrNK+XUxCn11zhGvPX9a5U/tA6dZm9hVPvUflPcjRTyWS7EimYkMaFQP2xxSDv80KvyEcrr1GOSgM50oAU7E8j5ATpnejkeIBqauOeFZX9aVsTpktEksedC4jRGXB4IYn+EIWQFSyUKUA6c1Y4HhyhTIRFbegfuR6PRc= X-MS-TrafficTypeDiagnostic: AS8PR03MB7270: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WdZVDWDTlXJA0cr6Fy9V+iVUd3gJqRLVYJwtdxksYkgFiw+QlTvmR0/SprA3zNPNwjRm+oycW41REz2bRjd8yFKzUVFHW5+9/Vr/Oxal9wTVP5LzLZMSJtjpf4wvwZezGyuPjWdOIlcL7dkFtggV1NriIKOBW10zpcWTFpLb5lT84jSv4nY9RVlgs6UqVcIxXZlwSBUTVuSujHAaH6CbTqoNvDc2b/6sIakZSjnvQjo5bDzMVYTDemQRKg3yec4AJ0w8X48B7bPBOtFlttbCXYJwk/l//eiGvG/RRCba49BBaTPEqBDaUz+CJAAYW72T60F4u7K8+r5dYWfrFUs9qV01rFQQgVnQVQaonikJGF0XUOThMKVkeHsQnNiDEOojOYzYkLGjGBpPbE2ntKn2vJ/ypU0+pPTvdyhytq1bXbp3V35whzXhYSO+sELr1Ony X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0k1rRvA70Fno3N+B7j0HWXZg1oc08MDdxMQJhDOUcpiBvEK8R3PkQKcDMOsfsIS7n6CGeO7ilEbvPHuDwIsb2jyz+BvGY9/zcTTlgOcxJDEZMV5uq7H7njpzcnoHotu5d1GmF7/SZKc7EPranA2Bxg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0887d64e-bc8f-4450-ed6b-08d96c7ce9ef X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2021 12:43:20.8107 (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: AS8PR03MB7270 Subject: [FFmpeg-devel] [PATCH v2 08/10] avformat/aptxdec: Use ff_pcm_read_packet 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: Xp6rbu8Jrno8 It automatically honours block_align and it clears the AV_PKT_FLAG_CORRUPT flag which up until now was always set for the last packet if the number of input blocks was not divisible by 256 (or equivalently: if the number of input samples was not divisible by 1024). It reads more data at once; this necessitated updates to FATE reference files. Signed-off-by: Andreas Rheinhardt --- libavformat/Makefile | 4 ++-- libavformat/aptxdec.c | 15 +++------------ tests/ref/fate/aptx | 14 +++----------- tests/ref/fate/aptx-hd | 14 +++----------- 4 files changed, 11 insertions(+), 36 deletions(-) diff --git a/libavformat/Makefile b/libavformat/Makefile index 7e0f587b41..becf07867d 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -99,9 +99,9 @@ OBJS-$(CONFIG_APM_DEMUXER) += apm.o OBJS-$(CONFIG_APM_MUXER) += apm.o rawenc.o OBJS-$(CONFIG_APNG_DEMUXER) += apngdec.o OBJS-$(CONFIG_APNG_MUXER) += apngenc.o -OBJS-$(CONFIG_APTX_DEMUXER) += aptxdec.o +OBJS-$(CONFIG_APTX_DEMUXER) += aptxdec.o pcm.o OBJS-$(CONFIG_APTX_MUXER) += rawenc.o -OBJS-$(CONFIG_APTX_HD_DEMUXER) += aptxdec.o +OBJS-$(CONFIG_APTX_HD_DEMUXER) += aptxdec.o pcm.o OBJS-$(CONFIG_APTX_HD_MUXER) += rawenc.o OBJS-$(CONFIG_AQTITLE_DEMUXER) += aqtitledec.o subtitles.o OBJS-$(CONFIG_ARGO_ASF_DEMUXER) += argo_asf.o diff --git a/libavformat/aptxdec.c b/libavformat/aptxdec.c index a5ed921e2c..2cbf9a2cb8 100644 --- a/libavformat/aptxdec.c +++ b/libavformat/aptxdec.c @@ -22,6 +22,7 @@ #include "libavutil/opt.h" #include "avformat.h" +#include "pcm.h" #define APTX_BLOCK_SIZE 4 #define APTX_PACKET_SIZE (256*APTX_BLOCK_SIZE) @@ -70,16 +71,6 @@ static int aptx_hd_read_header(AVFormatContext *s) return 0; } -static int aptx_read_packet(AVFormatContext *s, AVPacket *pkt) -{ - return av_get_packet(s->pb, pkt, APTX_PACKET_SIZE); -} - -static int aptx_hd_read_packet(AVFormatContext *s, AVPacket *pkt) -{ - return av_get_packet(s->pb, pkt, APTX_HD_PACKET_SIZE); -} - static const AVOption aptx_options[] = { { "sample_rate", "", offsetof(AptXDemuxerContext, sample_rate), AV_OPT_TYPE_INT, {.i64 = 48000}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, { NULL }, @@ -99,7 +90,7 @@ const AVInputFormat ff_aptx_demuxer = { .extensions = "aptx", .priv_data_size = sizeof(AptXDemuxerContext), .read_header = aptx_read_header, - .read_packet = aptx_read_packet, + .read_packet = ff_pcm_read_packet, .flags = AVFMT_GENERIC_INDEX, .priv_class = &aptx_demuxer_class, }; @@ -112,7 +103,7 @@ const AVInputFormat ff_aptx_hd_demuxer = { .extensions = "aptxhd", .priv_data_size = sizeof(AptXDemuxerContext), .read_header = aptx_hd_read_header, - .read_packet = aptx_hd_read_packet, + .read_packet = ff_pcm_read_packet, .flags = AVFMT_GENERIC_INDEX, .priv_class = &aptx_demuxer_class, }; diff --git a/tests/ref/fate/aptx b/tests/ref/fate/aptx index 22607e2b89..35729b77c7 100644 --- a/tests/ref/fate/aptx +++ b/tests/ref/fate/aptx @@ -6,14 +6,6 @@ b5d8a297c0e8d9854f19d9d3e8b82859 *tests/data/fate/aptx.aptx #sample_rate 0: 44100 #channel_layout 0: 3 #channel_layout_name 0: stereo -0, 0, 0, 1024, 4096, 0xcbb4ceff -0, 1024, 1024, 1024, 4096, 0xa66533e7 -0, 2048, 2048, 1024, 4096, 0x4f22ec39 -0, 3072, 3072, 1024, 4096, 0x45f117f9 -0, 4096, 4096, 1024, 4096, 0xad6c0b7a -0, 5120, 5120, 1024, 4096, 0x611618fd -0, 6144, 6144, 1024, 4096, 0x0ec02f2b -0, 7168, 7168, 1024, 4096, 0x2cf9ae5c -0, 8192, 8192, 1024, 4096, 0xfb008ac0 -0, 9216, 9216, 1024, 4096, 0x25068495 -0, 10240, 10240, 785, 3140, 0x5a260589 +0, 0, 0, 4096, 16384, 0xcc670736 +0, 4096, 4096, 4096, 16384, 0xf5a1020d +0, 8192, 8192, 2833, 11332, 0xcdf214ed diff --git a/tests/ref/fate/aptx-hd b/tests/ref/fate/aptx-hd index 8b62ea1611..fe611de03e 100644 --- a/tests/ref/fate/aptx-hd +++ b/tests/ref/fate/aptx-hd @@ -6,14 +6,6 @@ #sample_rate 0: 44100 #channel_layout 0: 3 #channel_layout_name 0: stereo -0, 0, 0, 1024, 8192, 0xa99888c6 -0, 1024, 1024, 1024, 8192, 0xc3e03a3c -0, 2048, 2048, 1024, 8192, 0x3f06e090 -0, 3072, 3072, 1024, 8192, 0x92fb18f3 -0, 4096, 4096, 1024, 8192, 0x3d5603a2 -0, 5120, 5120, 1024, 8192, 0xcc3d3101 -0, 6144, 6144, 1024, 8192, 0xbcc022ef -0, 7168, 7168, 1024, 8192, 0x600cbb73 -0, 8192, 8192, 1024, 8192, 0xdc938cbb -0, 9216, 9216, 1024, 8192, 0x37d968bc -0, 10240, 10240, 785, 6280, 0x48243144 +0, 0, 0, 4096, 32768, 0x00b6bc94 +0, 4096, 4096, 4096, 32768, 0x14411314 +0, 8192, 8192, 2833, 22664, 0xb4a826ca From patchwork Tue Aug 31 12:42:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 29917 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp4889004iov; Tue, 31 Aug 2021 05:44:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXIoAizPD3sc8/X3q1ZdMzAIMBvlAa4nO3g7qInkrcCrUV6qDoxL8kRP64fYiT4PXutwO5 X-Received: by 2002:a17:906:12c6:: with SMTP id l6mr31756764ejb.373.1630413860719; Tue, 31 Aug 2021 05:44:20 -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 di6si16782921edb.606.2021.08.31.05.44.20; Tue, 31 Aug 2021 05:44:20 -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=c6slcyFM; 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 2859E68A407; Tue, 31 Aug 2021 15:43:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-oln040092073086.outbound.protection.outlook.com [40.92.73.86]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C7C2C68A3AF for ; Tue, 31 Aug 2021 15:43:30 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bt+/O9a+N4oRoww4yTDrBNNT60kFf4dNdxLwbVlZnXbhAEYHtQnYZZyvnKEnJgoabFNmPbd2LzR5pgrUcydQPBbQE3hKhvNoIRcZ9MwJrsgbBaYtiPTWsgcgksEtkUwnHUV38x9WjMEi1MogR51ekj7Ge1butzGol+87yXnlk/u5EPQ7phJBS8jwvB2OPW5KZe232yAzVHidXISmA9+SpWCLFPnroV8wyz+ZlMiQdtlmLYFGVglVdJA5/08+f7dHfn6/Do3UlWSPpQn9vYPHN1xFLDoVUFkkwkCQDglg+UQ+hvLbTLDrjILKM87DJaE9QwQf+z70bv4CDWqO4mXagQ== 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-SenderADCheck; bh=nG4u8jh2gWoxUVClOFE0OZ6gmJIiu0aCPpxgK/vKOCA=; b=mTrw6Q8qFgH1O10WgxDm13JB1neM3WgbrUR+S/UQcALgKiKxBSKzI1Ngx+pxBqRPaGGXuzhMhxgLpiCDiC277ZHdWuEh28cD95XcuYoOvezVHw4ZMG496vrsOlg2W/qw9vRmsFo7+34HO3qST+Pz0eBiHJWCGi1vyoHeWVTvQ0HHsc6AwyKPBw7YrTT6+iQRSdHt8Rm3n9o8r6ot5/FxDVh3t6lEUjwPGDV2sPM8Zm8QQVg/fHYjZMPpB0UeceqqeciVIuE4ceSyy3GDfpC+UmL7dRiZY+Kt9Ji0EcyrUUFyk4vfWcMc/TwkBYEFRBe/pNxsmHOR1JjDJ9HO6GQh9A== 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=nG4u8jh2gWoxUVClOFE0OZ6gmJIiu0aCPpxgK/vKOCA=; b=c6slcyFMfBW6TC0CsFG66FFUO3+xXqPgv7yG8oP3PB6kxufV7HeRtbESJ+54QSBdHKV3OfvU7kswK0xYk2OYyBbYHmkciX/48WCydYjXK09MphcblHqHvgmLPLRRXaLFcsOPo4GvPs4gyk5vTyCEvPDHwrEN2dyfB1yvrYndPIDZZfwyFSw5UJ6Z95N3f5lwktfpPr0mAG31dE3jDsZQC3lhkGHt2KQ55zkKRQsE9Lu3K4JO62ehcmHCwe+qR6MbzQjr3WDG7LKTA7CJoV5tz6V74ixCTAp483WTNYGnt4/A9MMPv+eQzdZDyPtpboErsndGR4vJDm/s1KFsxmoDjA== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (10.141.218.86) by AS8PR03MB7270.eurprd03.prod.outlook.com (20.183.133.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Tue, 31 Aug 2021 12:43:22 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5%7]) with mapi id 15.20.4457.024; Tue, 31 Aug 2021 12:43:21 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 31 Aug 2021 14:42:57 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [RfCSONVohCMI48YEpDY5RJJrKwKj9O33] X-ClientProxiedBy: AM9P250CA0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:21c::19) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210831124258.1715917-8-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.142.38) by AM9P250CA0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:21c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23 via Frontend Transport; Tue, 31 Aug 2021 12:43:20 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4eacb717-19a6-4544-0383-08d96c7cea32 X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNVAewO3OwszBVL1NI+kAPIBUu3mol1yNCHIgeepzYr26B2esNb2g9Q9i//m1PbDZDeyYUMXmSNxmwu8iWLOqQ38yqXcG/3bujCENfP1dAheJd7fsdceixEL+yZkUijv1UDaD1+a/ZPoL+Q0kWwHX7OM76W4obrzNXpcj4e+O02i9Ad9l8znrl+QhKfxHGaHQiKU+Lx/K0DeMTrWQdabrzd/G3CnN+LMSnfui5bLwtYnkcd4Xnkb1dQJNjdW53FCUY1JKdLvwBQuNQoxoIN7kjz2mijNXPVXf14ccS661grUTqH5M8fKo3T4DVf31NThcta7NLaZWpiJaslVj6tsIpVdZP3vZsiByj84WlNtnn4nd75Cxp1YKRVMZunUxcyXSA4n4mWv8ljJSkPuO+RKKoYVyTHHvL7me63ouFtWpSUU96Dkc0v6nDDqXYo18F1zd5zNxWpzhBKfu+8tD269cl1i29bMtH4kdrUWiMRO3Pb52TP4v2oUjTLOUy/5jEUJTgjBLnMlqvgcEAt3IhJZqu3fcmda3e6Bb9AznD8TTrOnaoaRwwLPDkD1lHKWY3sQSQUNriOX1KeLaKqIAnt8xWZNr8P7kGJXqTGqP97Yk89/JHVtxY4dkTqqlDju1vk3ssh5SPS4VWHPvprV2+JE6aIVi+VBa1aWj4dWWpLz+Z8O47xT8uKvquK84iMn6aK12/Aq3RJawAiH+1zD/UAiRg5WPZI6bBBI+Rg= X-MS-TrafficTypeDiagnostic: AS8PR03MB7270: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: f1EgVQL4lJLjzi81lZxJTdQeb2yRXZWVRfFsqAZxR+QmtLvdbblc8aoeMGLw5HMKF7ex0XA9sf6Ycj1ZCjJlCwUWj2kDk/9txi+LWbznpMc6PalygiG73m3CysZ7bkKJYd3pPTTT2YKN5Ejy/GvewHlnYvSb7iI4NOyDkdVG10OMQCcAybaXiNkuVJ4PqJD8N/wM8zGpQwyHuPt8IGL7DNaQq83Xri3fd4Jmv7w6p1WMIiKYA3zANN0htpcw7X/HQeYv0KioE28e56y5wSDNXSzQLgCVdrwWmI0fnVX9DyYlmMrjNeNoIFW3mwDTyYfyzrFV4c4HbJ66vY0If8D4baGK6Bsg0Nsi2KkfcfzWAJGDDMmgPMAe/bWEk3Ne7S2JxkKcApVrdMoCZ9dmm+EwVs9hhwVpFFNtd8joF721M8wQWlAjuY7ndX/Z3rdLnv1r X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RnFkKf2lorHKaOeiPpdkwXzpbFoEi1tJuFOFAxW7S/iTfKVEO8/jgtFMDiiPtu9/qPgGtDwEDiSoBRjlybOwybMYPZqrc4qcfRTmITjEkWtYknTFsK68TS21+U5rnWtfrZFLJT5S3kBcivTMkIAyIA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4eacb717-19a6-4544-0383-08d96c7cea32 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2021 12:43:21.2647 (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: AS8PR03MB7270 Subject: [FFmpeg-devel] [PATCH v2 09/10] avcodec/aptxdec: Process data in complete blocks only 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: FdSyymGJaKf3 The APTX (HD) decoder decodes blocks of four (six) bytes to four output samples. It makes no sense to handle incomplete blocks: They would just lead to synchronization errors, in which case the complete frame is discarded. So only handle complete blocks. This also avoids reading from the packet's padding. Signed-off-by: Andreas Rheinhardt --- libavcodec/aptxdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/aptxdec.c b/libavcodec/aptxdec.c index bdcc076c41..de661476b7 100644 --- a/libavcodec/aptxdec.c +++ b/libavcodec/aptxdec.c @@ -148,7 +148,7 @@ static int aptx_decode_frame(AVCodecContext *avctx, void *data, /* get output buffer */ frame->channels = NB_CHANNELS; frame->format = AV_SAMPLE_FMT_S32P; - frame->nb_samples = 4 * avpkt->size / s->block_size; + frame->nb_samples = 4 * (avpkt->size / s->block_size); if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) return ret; From patchwork Tue Aug 31 12:42:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 29912 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp4889229iov; Tue, 31 Aug 2021 05:44:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzegAcFcoC4YGHjPTU7pwDgZ2mX7Y8G209TM4g0rIyn0HXbkZIcBVHNUmtNKuQ/z2UVQ+30 X-Received: by 2002:aa7:c54c:: with SMTP id s12mr28593804edr.96.1630413882601; Tue, 31 Aug 2021 05:44:42 -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 jg17si11027002ejc.92.2021.08.31.05.44.42; Tue, 31 Aug 2021 05:44:42 -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=ukWqaiCz; 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 0425068A4A8; Tue, 31 Aug 2021 15:43:37 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-oln040092073086.outbound.protection.outlook.com [40.92.73.86]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EF1FE68A3BF for ; Tue, 31 Aug 2021 15:43:30 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U5yRA+xr2qqSyces7ybGfkk/e8ULI2OaXtFjM/3dRIYsh0Uu0q/0xg06SlEsSS+fA8WUHe6v5Bxnacsg94EHW5LXKsV1IB/DLVwxV2dnmAgs7tOxQCJLA6rEuTSRX8gwXcmTrNrFTG5sdqs1oGu5IWojDRATos6Z01plTkW+owWl85ZjXw8bdK7DL7jKeOsa5wcnFXfUiWCbph7VTiEJ33shinm+9EhDXyqCoGhjX0yJbZ7Jpft50GlrLEdeM+OazZKgu1pXk8XJTVZkfdSWWuEct2WYNnXAHv5JQUIekdkPV+L55/RMSle3pp24lQClc+tnCnmAJ2JWSuY4c+LjDw== 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-SenderADCheck; bh=tdwzbfdaV8J53AQc7h2LBMZygoBdMmbCmbP5gxVEjfk=; b=oNiw7QSRFWeJgkcuYaRMgddLpd7NY4SOvdTqZ5V5BEkfX4F9yNrpVcomd6X7a/Zupvu9d1TPBE5iZcLEX8qkswfdc9yBviLywIWTcpm0pcessjNnDVQOjx2Etcm+MkmWHZCeRLUM4HmPV7YAVhTty8msmtP1P/xGmE8UB+TvnRby/gdISQS7YllT3PqMOVFQKV2KQnXJwyUTZIDOcH/hElBN5NH6kA4ehqjxZfUPJPY4uOjeUvYa1iH4OlWF4GID2TzwYj5p9HZLs4yBppHEQ2YHiXbvs5qI03nBjzfI5TXJEi9nWJo5+L5HJGl06n+UnE5NTsnzdZ3do2maar7ffQ== 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=tdwzbfdaV8J53AQc7h2LBMZygoBdMmbCmbP5gxVEjfk=; b=ukWqaiCzHERo8FanYgsmjWM7iOPGmtbuFDzAvIOrvaIEFzOAvZU5imkMYhL65JNVLIlcDYQebKnqdPn3UkDcSoNXCYK8JWi2tqMorRJ1Ns4gnqBHMLBwKkKiR+/p+O//ulfvjBv/Bt5GULO2MzjyRqePk7qpGRiw92iqAaB7Fg4Bjej4k3uARzBtDFGA3TiZ3Rd19j2j7uNwAXuEaEUMoNaQlhETdLwdRYS47iqIooYyZwKw69BIhCZVLNdCTyMrTljWnXkP9N9KNc5k9+cB65LNk4cl10H5yg1410Qg71zVy82LqDdvsewXVFrG8USZR0S+y83DN9T3SjS8Ho5/uQ== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (10.141.218.86) by AS8PR03MB7270.eurprd03.prod.outlook.com (20.183.133.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Tue, 31 Aug 2021 12:43:22 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5%7]) with mapi id 15.20.4457.024; Tue, 31 Aug 2021 12:43:22 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 31 Aug 2021 14:42:58 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [hqsQB4fzFTRk/I/z5FtCpFlh/0n+PFgz] X-ClientProxiedBy: AM9P250CA0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:21c::19) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210831124258.1715917-9-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.142.38) by AM9P250CA0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:21c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23 via Frontend Transport; Tue, 31 Aug 2021 12:43:21 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 713afbac-f3b3-4872-29aa-08d96c7cea75 X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNVAewO3OwszBVL1NI+kAPIBGlUN6d+qDo7Zpo8/AfooYpLIJWwzwv4gRDo8w6D94cMD1E7aH5XTesDDGPB/7uIs0F60+plDm6ZjGNBJsj0e1zoTE/OvCETyw9Hd9zZl4MbNPg8zjqQd8u2BpO3ClAeNaHCF0J4ZMFBm89bon9e26FLlF+wSZuH9WgSu4AqSHI+mo6MMw0zr63v8PPtc3cF3JYohR3vgum20kjO4pu++/gviZMCNhsvodagXlfI8PWH/dqZB6ZHG++aZTou4b6YulldiNkDTJAtE9Q5rDwvBOvaoRxhiPGJGwX6+dcUs00xcgl9ZsbQI31wvjOOxqnszjU7lhk9wBriuDTXljJDNM7E0G87cSJs802hqvmOAn8FPP2DgeDU7N7kzfeVnxEqVwGjubt6Gto1NIisMlkcTkIPlDbvgUnF70nuCJ3eMykx3ZZfJ4EdIXE2l/F1D9EXy2Dy8K8tnvURgV5YmcQ8To+XakySxv9yn4gm5JuWN4L82Fesl6Z6IxJ4UqL998TTNVYcDdyM999hWaXBbchOw6m9YI9l3lXBZnBpSeqqzec4t+IriLHeEyEoRLq+LXn7qw0imoW7tyQE1aBgqRrYOuQJEsDr5uNmi6oyUoKG2DZFAyvOM0ArrtDwftCWZaU+ckt2eRVl2z4OsLtTPVFq+3A/ft7h63QZFrvUlP0sTOAPYqYquyUjgyyDGd8UyWVADNdJ+Vadufcc= X-MS-TrafficTypeDiagnostic: AS8PR03MB7270: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: w36SwgJlNU+auCKDAiqdawrLflppnOc1HqH8D0aQx6BOsVtHmx7MgDQk2OzAJ0Z60LesKVvOmEyFn+9wP1AQtGEtTXizhIFtJoBCWNAtJbELTI68hhIBF/95vSFfo5qrqM3zzG7v7JTyMGrH+gjLm0xdfHCG8ynBgyIz/cd9XIWKIsJCzYGvuI+Rri5L9rKHMZ0JQyCD4Z0//M/+CsVdAZ3rgeqiYbgBzJtQMlfEmEHuKUfmoKizjl679+Ol3YyIzhwauPOq6Jd/urX3ob+adjONbmaQslbuIWejUibQdvmjieJ3gH5sa/9US9tWfGvKYVxE0pikUbHSQUEWEphLqJq2DnEg3wMXAGatRc/Q8WU4kWZObnkXQOnQI9nESUM/w5t+GGLS5G59f3blcej1Pj6JXSbivFg3PV6V6bOZd+PTNuX0hUcaGBxhZfFtcjgv X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: b69ENiBH814H70G3stZjueZva2Ag3fbsODOQ+KuK6vECDCCqclFAk+Iui/i2Dc8FcrVEqIpPIoQkv3muZdss0P3qWbsEsjUSJdZK8L1zoxguJSxY0ZmIhY8ED8c+M52ulGturqiSs79llOa5kwWRIA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 713afbac-f3b3-4872-29aa-08d96c7cea75 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2021 12:43:21.7197 (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: AS8PR03MB7270 Subject: [FFmpeg-devel] [PATCH v2 10/10] avcodec/aptxenc: Process data in complete blocks of four samples only 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: OIkSzd/XAtIy Otherwise one could read into the frame's padding when one encounters the small last frame; furthermore, one would indicate a packet size that is not a multiple of the actual block size and one would write into the padding of said packet. This actually happened in our FATE tests (where the number of samples is 2 mod 4), which therefore needed to be updated. Signed-off-by: Andreas Rheinhardt --- libavcodec/aptxenc.c | 5 +++-- tests/ref/fate/aptx | 4 ++-- tests/ref/fate/aptx-hd | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libavcodec/aptxenc.c b/libavcodec/aptxenc.c index 5ea6053c26..0760d1932e 100644 --- a/libavcodec/aptxenc.c +++ b/libavcodec/aptxenc.c @@ -215,7 +215,7 @@ static int aptx_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, if ((ret = ff_af_queue_add(&s->afq, frame)) < 0) return ret; - output_size = s->block_size * frame->nb_samples/4; + output_size = s->block_size * (frame->nb_samples/4); if ((ret = ff_get_encode_buffer(avctx, avpkt, output_size, 0)) < 0) return ret; @@ -229,7 +229,8 @@ static int aptx_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, aptx_encode_samples(s, samples, avpkt->data + pos); } - ff_af_queue_remove(&s->afq, frame->nb_samples, &avpkt->pts, &avpkt->duration); + ff_af_queue_remove(&s->afq, frame->nb_samples & ~3, + &avpkt->pts, &avpkt->duration); *got_packet_ptr = 1; return 0; } diff --git a/tests/ref/fate/aptx b/tests/ref/fate/aptx index 35729b77c7..ccc3a49ac9 100644 --- a/tests/ref/fate/aptx +++ b/tests/ref/fate/aptx @@ -1,5 +1,5 @@ -b5d8a297c0e8d9854f19d9d3e8b82859 *tests/data/fate/aptx.aptx -418950 tests/data/fate/aptx.aptx +966f4391a8472208409a52603494846f *tests/data/fate/aptx.aptx +418948 tests/data/fate/aptx.aptx #tb 0: 1/44100 #media_type 0: audio #codec_id 0: pcm_s16le diff --git a/tests/ref/fate/aptx-hd b/tests/ref/fate/aptx-hd index fe611de03e..a3cb78daa5 100644 --- a/tests/ref/fate/aptx-hd +++ b/tests/ref/fate/aptx-hd @@ -1,5 +1,5 @@ -48ecaa81ee5adaaa62ed3ff6574b6666 *tests/data/fate/aptx-hd.aptx_hd -628425 tests/data/fate/aptx-hd.aptx_hd +0bb7bb4313bd33fe44e409c67d392fd0 *tests/data/fate/aptx-hd.aptx_hd +628422 tests/data/fate/aptx-hd.aptx_hd #tb 0: 1/44100 #media_type 0: audio #codec_id 0: pcm_s32le