From patchwork Tue Jun 21 06:46:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 36365 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1a22:b0:84:42e0:ad30 with SMTP id cj34csp2050696pzb; Mon, 20 Jun 2022 23:47:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vh5acStnggJE40rXOIt45a7fEklGuweoYcTBvgOSYtBOkpgcfESCdGpMWAF6p0zi3oiVX2 X-Received: by 2002:a17:907:6d8b:b0:71d:9537:38f8 with SMTP id sb11-20020a1709076d8b00b0071d953738f8mr16825144ejc.72.1655794025192; Mon, 20 Jun 2022 23:47:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655794025; cv=none; d=google.com; s=arc-20160816; b=bcggdGT0YID5y5bkUI8Q8YklUUJsYmdEc9schdyOmL7BRMK6Bvend/moXbDOv+B+Xb 3QKVj6DDTpXfNuWOxf0o2pD45Va8ugPLg4WNkRlDUjVIS/wCgSeXJi7veea/f2oyfbX1 iDXUDE3Bgpd2EgYE4GijYJvd6jF20I88bsAKNLh03jsnsmMdg8XksWgZXpl4hlJOK8SY fmgOhzpONXAB/7FYIBAWGzgVyCyvJg+JdfKWuMFqJTTHDo/SeemBoJTRUXcYKSXt85jQ Fq9eCCh+OHnuou9qrh9mB+TS/SqztUS5ESP2RSRp/3y5vRRXVyf2qlSdaOCgSuFL0e0Q fXjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=ehTt8IIZfIT8ecI+E3cUNphuLBPL0p+DQzkLcvNodY4=; b=DX3cjt18IbNw6q9WGkgR8gWE/3zRNyPw1COC0kyZ/VvrKQDZn4QMNdxH74vGD6bAyp XE3CmMsyGBQxyVMlkgryWHJqlrNSonyyUcUfpdlSTf3uEfb+tJV1zN+5OU589XEKPzSL ihvXZ20beJs5/xNo3mGFNpYdPC8hYPFsWuJ4oTmTGIBKKQ5V14pVGSzqloFI+1pw62JM Fx9g/u7/eWwIZs4rBdGQGcaISGTnWE06W9QP8GkXhn983QcYlIW9f48p+hYN9A4f7FN3 +Biom3GChvos6HCTKpba/zmx33BFFdIQQdItmpe+HA/eF1p9PH0xwI+gFelWgnaQPO3m v6gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=dC8CUz08; 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=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id zb13-20020a17090687cd00b007121178dc1bsi17657542ejb.735.2022.06.20.23.47.04; Mon, 20 Jun 2022 23:47:05 -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=@gmail.com header.s=20210112 header.b=dC8CUz08; 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=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4D7AE68B661; Tue, 21 Jun 2022 09:46:49 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 75C3668B5B0 for ; Tue, 21 Jun 2022 09:46:42 +0300 (EEST) Received: by mail-lf1-f52.google.com with SMTP id y32so20731594lfa.6 for ; Mon, 20 Jun 2022 23:46:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=MBgWY8MNwEms86OI0H2jLoltmmviCags1Ep62MVQRkM=; b=dC8CUz08g34M7CgEYvtfOPPOpN/cd0xjNQexsoA0twvg7VOoLTq36B0mT4j57zXAy/ R5fQkptxE5eI7MD8OdfIzBQPfIywTbhSm29OTAd7AIj12PmV/IqRHFA1e9J27UoB7C38 CcdZxKeptF3qyHqnqpJUAEVRVkOYBSt7RY+K2zAf3/2OJHai75UUM/Keuxm/KOi6fhP/ XL3bxregMLA2jWtqSka0DcHR6Dz3fWTeXDauLGw9TpZs1JHy1Vk2Ez0GY+9dJk2/jPAl ZsW7b0iZ8uKHZUWOVKTP6gskdDGybj8R4zydiuSbcHsDInb0vQx6+8YBhxg0pfGZxU5D Sl5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MBgWY8MNwEms86OI0H2jLoltmmviCags1Ep62MVQRkM=; b=pA5css49pTEo16D8+9NWWFXNRwoHndbJlvnzketO6oCsYzKcSWHHGb9mgTAHSNZKJu GBIiAw7ju/oxNv52Ih7lZ9i3wByZ55Ce+ebSFpZga2AVyhl+o+D0laGtAHotgHneeShA tIz0KPfepk+CGlGz2ymbL5oSeCGg9yfjUzZk6gS4u5ABFj8QnLsOCd3zrC+sjjMaFHuj +YEM3i7a6vNTk7+SSmV5Dkp923yvhyJMSmD7AocrhbwujYOyynmDHYedQBUnURS3EIqc 8tXtuCuPNrAKpmJi7eNWaK2BCbikFFO90yZBj5s2SApzEy05nO4XvhJQpEv1kNLdOGwB FEIQ== X-Gm-Message-State: AJIora9iFRDzIE1JnMTkFc5oBu63ixNMZWEfRVWXeseothXE4E0R0UE0 OBC9zwjLIvR60dSjOaR2U6ZrO/4crkA= X-Received: by 2002:a05:6512:a96:b0:47f:4295:73d3 with SMTP id m22-20020a0565120a9600b0047f429573d3mr14943668lfu.470.1655794001717; Mon, 20 Jun 2022 23:46:41 -0700 (PDT) Received: from localhost.localdomain (91-153-198-187.elisa-laajakaista.fi. [91.153.198.187]) by smtp.gmail.com with ESMTPSA id u18-20020a199212000000b0047255d211c7sm2046767lfd.246.2022.06.20.23.46.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jun 2022 23:46:41 -0700 (PDT) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Tue, 21 Jun 2022 09:46:29 +0300 Message-Id: <20220621064634.16797-2-jeebjp@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220621064634.16797-1-jeebjp@gmail.com> References: <20220621064634.16797-1-jeebjp@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 1/6] avcodec: make AC-3 bit rate table available in a separate header 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: VKBWQokE//lm From: Jan Ekström This makes it possible to include it from libavformat Signed-off-by: Jan Ekström --- libavcodec/Makefile | 8 +++++--- libavcodec/ac3_bitrate_tab.c | 22 ++++++++++++++++++++++ libavcodec/ac3_bitrate_tab.h | 33 +++++++++++++++++++++++++++++++++ libavcodec/ac3tab.c | 6 ------ 4 files changed, 60 insertions(+), 9 deletions(-) create mode 100644 libavcodec/ac3_bitrate_tab.c create mode 100644 libavcodec/ac3_bitrate_tab.h diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 3b8f7b5e01..10697d31f7 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -190,8 +190,9 @@ OBJS-$(CONFIG_AC3_DECODER) += ac3dec_float.o ac3dec_data.o ac3.o \ OBJS-$(CONFIG_AC3_FIXED_DECODER) += ac3dec_fixed.o ac3dec_data.o ac3.o \ kbdwin.o ac3tab.o ac3_channel_layout_tab.o OBJS-$(CONFIG_AC3_ENCODER) += ac3enc_float.o ac3enc.o ac3tab.o \ - ac3.o kbdwin.o -OBJS-$(CONFIG_AC3_FIXED_ENCODER) += ac3enc_fixed.o ac3enc.o ac3tab.o ac3.o kbdwin.o + ac3.o kbdwin.o ac3_bitrate_tab.o +OBJS-$(CONFIG_AC3_FIXED_ENCODER) += ac3enc_fixed.o ac3enc.o ac3tab.o \ + ac3.o kbdwin.o ac3_bitrate_tab.o OBJS-$(CONFIG_AC3_MF_ENCODER) += mfenc.o mf_utils.o OBJS-$(CONFIG_ACELP_KELVIN_DECODER) += g729dec.o lsp.o celp_math.o celp_filters.o acelp_filters.o acelp_pitch_delay.o acelp_vectors.o g729postfilter.o OBJS-$(CONFIG_AGM_DECODER) += agm.o @@ -1110,7 +1111,8 @@ OBJS-$(CONFIG_LIBZVBI_TELETEXT_DECODER) += libzvbi-teletextdec.o ass.o OBJS-$(CONFIG_AAC_LATM_PARSER) += latm_parser.o OBJS-$(CONFIG_AAC_PARSER) += aac_parser.o aac_ac3_parser.o OBJS-$(CONFIG_AC3_PARSER) += aac_ac3_parser.o ac3tab.o \ - ac3_channel_layout_tab.o + ac3_channel_layout_tab.o \ + ac3_bitrate_tab.o OBJS-$(CONFIG_ADX_PARSER) += adx_parser.o adx.o OBJS-$(CONFIG_AMR_PARSER) += amr_parser.o OBJS-$(CONFIG_AV1_PARSER) += av1_parser.o diff --git a/libavcodec/ac3_bitrate_tab.c b/libavcodec/ac3_bitrate_tab.c new file mode 100644 index 0000000000..9ae8794a4c --- /dev/null +++ b/libavcodec/ac3_bitrate_tab.c @@ -0,0 +1,22 @@ +/* + * AC-3 bit rate table + * copyright (c) 2001 Fabrice Bellard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "ac3_bitrate_tab.h" diff --git a/libavcodec/ac3_bitrate_tab.h b/libavcodec/ac3_bitrate_tab.h new file mode 100644 index 0000000000..44fc5f59ec --- /dev/null +++ b/libavcodec/ac3_bitrate_tab.h @@ -0,0 +1,33 @@ +/* + * AC-3 bit rate table + * copyright (c) 2001 Fabrice Bellard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_AC3_BITRATE_TAB_H +#define AVCODEC_AC3_BITRATE_TAB_H + +#include + +/* possible bitrates */ +const uint16_t ff_ac3_bitrate_tab[19] = { + 32, 40, 48, 56, 64, 80, 96, 112, 128, + 160, 192, 224, 256, 320, 384, 448, 512, 576, 640 +}; + +#endif diff --git a/libavcodec/ac3tab.c b/libavcodec/ac3tab.c index 48c89a8ba0..75865fd7d2 100644 --- a/libavcodec/ac3tab.c +++ b/libavcodec/ac3tab.c @@ -94,12 +94,6 @@ const uint8_t ff_ac3_dec_channel_map[8][2][6] = { /* possible frequencies */ const int ff_ac3_sample_rate_tab[] = { 48000, 44100, 32000, 0 }; -/* possible bitrates */ -const uint16_t ff_ac3_bitrate_tab[19] = { - 32, 40, 48, 56, 64, 80, 96, 112, 128, - 160, 192, 224, 256, 320, 384, 448, 512, 576, 640 -}; - /** * Table of bin locations for rematrixing bands * reference: Section 7.5.2 Rematrixing : Frequency Band Definitions