From patchwork Sun May 19 16:54:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lynne X-Patchwork-Id: 35126 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp4001331pzb; Sun, 19 May 2024 09:55:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVcOKnKNL8OkkUY8M+kgJQN2Y8WRhsZxy+yuH2SJPP/auYzvbxcb3DmwyoUGOI8PpQ6+TY4irx+aBzBa+ZgKb2ZBLgDchh4M9jGwg== X-Google-Smtp-Source: AGHT+IFng0mPx4irEq8hocQDONr2w5Gdu79GiZHGeyb3+/X53wrmAcDw78yByXBK843a+QP5+jy3 X-Received: by 2002:aa7:dd12:0:b0:572:d841:1189 with SMTP id 4fb4d7f45d1cf-5734d6f576fmr18065280a12.3.1716137711044; Sun, 19 May 2024 09:55:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716137711; cv=none; d=google.com; s=arc-20160816; b=r8IlffZoHqtIKde6nG2+fw3RViT/RVLEmCQke6p8EEZNDyLOUbqLpHy+2EjBbuU7p4 5rzSPvpiGVE6asbl4duF/e4DdOae4YSflDDarwH2Kjhr8aUzqzk5nycyL7yMD96G3yqb glaOyhlomN24hjDm9KzwIomntLSoQLNpUTzIzCO6wHh4tGHgjFA49y/noBoO1j4qzyfT fRPpfM5xCwr1qotOP+VtEKTvOJnysAlL35yaDpSyzC8iVqtlm2NHjSN6Lg2hadtaE/v9 p0MCX+DserJNj7xO/dSn46rnLPWWddtdmewSUCcMJwVRV4hsJZZQdXstZeXpGCs6XdMT 4n5A== 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=HzbWuiciJn3Y6E/Z3EfG5BvXW0TcPo3yyYtUwP05dlU=; fh=nenT92/WZoU6unXd3J6UhGUdod4piddKfVtctNBOh6k=; b=y0SpTurvkCLgADQkOPQSdlNd48A4sZHrdwHNLsP48paTSX2j+u2kwv5IJBRDv2Jpzq ZdXv/1WzlZRrdPGh54I4iyGnZTi2dCXyDdpBhCp1ajk+qYHa3MMzbpwpYI4p4v7YB8lg jkMwO7SHrqkezzJT43yYjkw9i5MnfbNZeA1Km2oLN9bxW48zgrmgayWNoLK7LKqkdt/9 XaKwEfmxV2WKCpE8ep2oyQQK9EyJMKiCoB/S5N1lwMe0vlCTvyKeQoNahuKc5AM9QVIE rug778sHHWNU1RnL+BBz9K2DlE95xHqCHfREFUHK+GAvuaZfQkSYyHEiERgc0KELKehB vPSg==; 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 4fb4d7f45d1cf-5733c32ce9csi11913000a12.467.2024.05.19.09.55.10; Sun, 19 May 2024 09:55:11 -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 119F968CDB6; Sun, 19 May 2024 19:55:07 +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 8EDE168C27B for ; Sun, 19 May 2024 19:55:00 +0300 (EEST) To: ffmpeg-devel@ffmpeg.org Date: Sun, 19 May 2024 18:54:36 +0200 Message-ID: <20240519165444.829271-1-dev@lynne.ee> X-Mailer: git-send-email 2.43.0.381.gb435a96ce8 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 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: sgE4UP0c5uxv This patch adds support for the frequency domain part of the xHE-AAC standard (ISO/IEC 23003-3). The speech synthesis support is to be implemented with a later patch. LPD is left as a stub with most bitstream parsing complete. The DRC support is left up for discussion. The DRC system is pretty much exactly ReplayGain2's system, so we may want to expose it and be left for users to implement. Validation does depend on DRC, however, so if we did it externally, we'd still need a filter. Changes from V1: - Preroll implemented - Complex stereo implemented - More robustness and bitstream validation - Surround/multichannel support - Desync fixes 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 | 371 +++--- libavcodec/aac/aacdec.h | 219 +++- libavcodec/aac/aacdec_ac.c | 208 ++++ 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 | 198 ++++ libavcodec/aac/aacdec_lpd.h | 33 + libavcodec/aac/aacdec_usac.c | 1587 ++++++++++++++++++++++++++ libavcodec/aac/aacdec_usac.h | 39 + libavcodec/aactab.c | 560 +++++++++ libavcodec/aactab.h | 22 + libavcodec/sinewin_fixed_tablegen.c | 2 + libavcodec/sinewin_fixed_tablegen.h | 4 + 17 files changed, 3247 insertions(+), 235 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