From patchwork Thu May 16 10:08:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lynne X-Patchwork-Id: 35124 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp2129310pzb; Thu, 16 May 2024 03:08:53 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWBN9DPSqmON74oW+G+oFkRq/YPT0TtByQyZouKLjKxasuh/nHwPRywCraEhT4A5KrNYSeFWF2WzdOe22qGkTmsOcDDsj77po6DEg== X-Google-Smtp-Source: AGHT+IEZUeJf40XxH25yd57FYGSwkcHsyJBjVy/lv7N85VQ7V4k0RgLji10zLq0L5kbwTPSUy3b8 X-Received: by 2002:a17:906:53d7:b0:a59:d6ab:7889 with SMTP id a640c23a62f3a-a5a2d65ecddmr1274657966b.47.1715854132730; Thu, 16 May 2024 03:08:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1715854132; cv=none; d=google.com; s=arc-20160816; b=G/5uUriXrg8qz7ghy4/Vwms4zNCKZ6Kv1iIlHuR5CeG9wSZsfgMJ1Wv0ZZ3isS8EdV vprTvJTfSngW3V0/jMNl7x6jo4ZanGgmR2G2dxiMY153CtrCpPbOlrovamlt4iooK+jO PhSOh5Uv1O8m4Yr1LuRFOx0lVsUPUXzI2LfbeOX+4R8Sh3sqqgYvJTKgIgmGUPE2hoU9 YemPjimMZGXvaaZC2T50CYlhPyO4hbZKlzmgSwq7D9HElfRC+5fKHT773uRAJF7dJN67 XUbG+FEIjglvKPKk+sG8g10wrTngMBrJ+q0xbpvAS/jIPMLFXpIAVXm7isIq4LDlpZYk iR7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to:from :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to :delivered-to; bh=FgnzPZgoWGN9tYxhlZvbK91vgH3TNm7knF68SIgDWq0=; fh=nenT92/WZoU6unXd3J6UhGUdod4piddKfVtctNBOh6k=; b=lDI7zxrqQCmy0qoLGeXKUmyoB3qgep+MyDOncxWBmvb28q/JrX45012hdZbhKSOceS C5JQlRf4U5z2iBlOgWCCEnAYTsg8BmZPLvLMoUK75Dm/0iD3NSAE9k2u2mHBo4wYz5Ep bvZi/I37707BqPGJpQUArcHQCL5mMo0ywJ3yGQ5c/J2iaoWo7nxyKT+j2yEzGe4udhMv +k/wPuZBv2P2qqLb4ggN+XxFTcKDrZi2V9rLY9YPeTLq18JumEqKEXHN5QWa6Fpd4OeB ogxUnL1AIDFAPU23ARQPal2QZvuBeI/Y7VBc/OOD6ePar1AISaEafQhQ3LRT6wWyouUj Z3GA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a640c23a62f3a-a5a17c2c670si867966166b.992.2024.05.16.03.08.52; Thu, 16 May 2024 03:08:52 -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; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1FB2868D225; Thu, 16 May 2024 13:08:48 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vidala.lynne.ee (vidala.pars.ee [116.203.72.101]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EC0A568D2AC for ; Thu, 16 May 2024 13:08:45 +0300 (EEST) To: ffmpeg-devel@ffmpeg.org Date: Thu, 16 May 2024 12:08:10 +0200 Message-ID: <20240516100818.246162-1-dev@lynne.ee> X-Mailer: git-send-email 2.43.0.381.gb435a96ce8 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 0/8] aacdec: add a native xHE-AAC decoder 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: , X-Patchwork-Original-From: Lynne via ffmpeg-devel From: Lynne Reply-To: FFmpeg development discussions and patches Cc: Lynne Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: nfBbbAuqLqCx This commit adds a decoder for the frequency-domain part of USAC. What works: - Mono - Stereo (no prediction) - Stereo (mid/side coding) What doesn't: - Preroll decoding (every single decoder seems faulty or weird?) - Complex stereo prediction Known issues: - Spec incompliance due to the spec being flat-out wrong in 11 cases. - Spec compliance due to the spec being woefully underspecified. - Lack of robustness - A single memory leak in packet fragmentation. I've reached out to the spec authors to get a conformation. I'm reasonably happy with the way I integrated it to send it off for review ahead of spec issue clarification. Lynne (8): aacdec: move from scalefactor ranged arrays to flat arrays aacdec: expose channel layout related functions aacdec: expose decode_tns aacdec_dsp: implement 768-point transform and windowing aactab: add deemphasis tables for USAC aactab: add tables for the new USAC arithmetic coder aactab: add new scalefactor offset tables for 96/768pt windows aacdec: add a decoder for AAC USAC (xHE-AAC) libavcodec/aac/Makefile | 3 +- libavcodec/aac/aacdec.c | 364 ++++---- libavcodec/aac/aacdec.h | 211 ++++- libavcodec/aac/aacdec_ac.c | 224 +++++ libavcodec/aac/aacdec_ac.h | 54 ++ libavcodec/aac/aacdec_dsp_template.c | 162 ++-- libavcodec/aac/aacdec_fixed.c | 2 + libavcodec/aac/aacdec_float.c | 4 + libavcodec/aac/aacdec_latm.h | 14 +- libavcodec/aac/aacdec_lpd.c | 192 ++++ libavcodec/aac/aacdec_lpd.h | 33 + libavcodec/aac/aacdec_usac.c | 1230 ++++++++++++++++++++++++++ libavcodec/aac/aacdec_usac.h | 47 + libavcodec/aactab.c | 523 +++++++++++ libavcodec/aactab.h | 15 + libavcodec/sinewin_fixed_tablegen.c | 2 + libavcodec/sinewin_fixed_tablegen.h | 4 + 17 files changed, 2850 insertions(+), 234 deletions(-) create mode 100644 libavcodec/aac/aacdec_ac.c create mode 100644 libavcodec/aac/aacdec_ac.h create mode 100644 libavcodec/aac/aacdec_lpd.c create mode 100644 libavcodec/aac/aacdec_lpd.h create mode 100644 libavcodec/aac/aacdec_usac.c create mode 100644 libavcodec/aac/aacdec_usac.h