From patchwork Mon Apr 19 14:09:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 27026 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:5014:0:0:0:0:0 with SMTP id e20csp556328iob; Mon, 19 Apr 2021 07:12:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpXDRQGa0LffmarKWg91QiDCzhXW6ysx/0j9jxPJEvFkPb17I0/Qq7Q5FmhkcCggGppAai X-Received: by 2002:a17:906:cec2:: with SMTP id si2mr22951053ejb.234.1618841546300; Mon, 19 Apr 2021 07:12:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618841546; cv=none; d=google.com; s=arc-20160816; b=OA2j30aHepy50K2ghb+7Z8ox4v1rENb9jDGafP9wIuVEUIpCygTT9wbnbfbNnA1qET FP47UlbGVFDuHG1Zr+tPt9GVoShseC4uqBCk6T2dXw7PDC0M0QfXGi9i+2Ag5+22zF6T 69apKJs7ydxHU9obTnn+KosOuNblwMjpp0pqHg02KBqqZqsIrIkIt9QVQAEVdciJJSbs beOrVEN5oayU3Vk2gPlYqALP5XaMjccz1dEWFLgbPyEwBb6JNaHzZB2aZFFkOmseoTKK E8+eaNx9j2nawjSGNbb2ctSd7GJDRBxVDWx+I/ZyEQedH5xY3hDDZWCHHUAYs6vx43Zj tclw== 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=DvC+7gXqshA4NCeinSXL11btm189PxE10Y01QVCWjy8=; b=LtKXCBpTkmASwvehkI8A/vTzQ6tTuplkVYtTz5wd8OZWLEOlwHL7GEU9PDgV95Mauv fevGjSJnEbtCBM3ztSH8DcDP7BTGGmQ1Rr8Ei0VmEmGZ7XuKu+horAcE3d0+y9a5aJie IAJ6k5LQLuW40UcAhQYXom47KAvv8i1g07XDI5iQ4WGbO8e0j+UwfuOAv879UPTJILg2 bBXuTpiGWUHbdemJmfCfIAZKSBt0DxE2SpoVzrNniOpeOVoLjcEBXz/bMQq68oAOJ0av DZJ6xNNAobUC8ycKEdAfAFjr3Ph6nOrS4Ihq+bhTfVtYj4oNBTDybF1aCFW9gNqYqwZt SKXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=G6G8soyN; 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 op17si12663036ejb.131.2021.04.19.07.12.26; Mon, 19 Apr 2021 07:12:26 -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=20161025 header.b=G6G8soyN; 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 019ED680AEA; Mon, 19 Apr 2021 17:11:27 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 87DE46809AE for ; Mon, 19 Apr 2021 17:11:25 +0300 (EEST) Received: by mail-qk1-f178.google.com with SMTP id t17so7379159qkg.4 for ; Mon, 19 Apr 2021 07:11:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=duTnZBpyfdFFlYf2L8T38E+Wp/q2opQd9yt9qiSBy/I=; b=G6G8soyNwEnvf0iGRpSOl2uIkYzOz19Am2pRsT82J7eaorGVbYbDqmmhXOnRLJEg+S npqjdLp83LOAPUBgrFihLM6VZyLAZ005fguDXEriKHYkUdiqN6Xi77ZWLWQzT2e0qGyc yEwaxdN/A5Q9RbW7Kkf9e+OznA/6Xlk9XJ3i2/mGQ780BlKPpZV9Phw/9BRGPbvYwb0D dj3LAJzw5M68OE0StBJTBqD270QUQlHyA5gmq5L8wdbfrPA/MDc7krJ/4SdEg4slL5C0 4g70+/k623anmlQnd+1EsyJ5KfuwlkfCMaIAnK8S72uc1aiiNgsgty78FwwAsY1ksfUz kkQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=duTnZBpyfdFFlYf2L8T38E+Wp/q2opQd9yt9qiSBy/I=; b=gnTsP7fKOVXRPMRc+/aVkHBPNeQ0jH7zgwX7S9tT0nL51Cn4ngAAlUfvlyZlqw7UEC u0pcGjBe5FAyxkcedsDiwMbAWz3Q+sd4WwvH0yogqJBgLFDZvFc1RNguQwN0wajdMUDt LjfchTT4xTgSZC6dHtNM+eRYtRo2/DVH7qjNr8Q/kZ4zMsv+kBFxRNVQ6r9wcMXgjBwC xcdXZE/XTnipQ5s+hpk2UTOaW0DHPivhJZP0f3TFk6H/+pRVeTzkVIljvme+63MXDYV4 6/VdYK6kgwL91hCJ2NxxD8KPSt7gNbcjTg0vEuOPb4Wwsgb76GZrvdX1P6LhRih8jpVk ulUw== X-Gm-Message-State: AOAM532tAAjivwo1eMyIzSHHPcJpYv79ra9+iGbxZxm5XKKQ1ZnSXllj 0caq/n+EnST+7MPOmY1ogggc7Z6OED0= X-Received: by 2002:a37:2ec4:: with SMTP id u187mr12416218qkh.472.1618841483845; Mon, 19 Apr 2021 07:11:23 -0700 (PDT) Received: from localhost.localdomain ([191.83.209.133]) by smtp.gmail.com with ESMTPSA id f7sm2049494qtv.53.2021.04.19.07.11.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 07:11:23 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 19 Apr 2021 11:09:15 -0300 Message-Id: <20210419141024.8174-19-jamrial@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419141024.8174-1-jamrial@gmail.com> References: <20210419141024.8174-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 18/87] avcodec/codec2utils: Remove legacy avpriv functions 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: tVqLfmpCN0T2 From: Andreas Rheinhardt Unused since 37d742b607d47122d23d548ffd7ad9b09cbc5298. Signed-off-by: Andreas Rheinhardt --- libavcodec/Makefile | 7 +--- libavcodec/codec2utils.c | 82 ---------------------------------------- libavcodec/codec2utils.h | 18 --------- 3 files changed, 2 insertions(+), 105 deletions(-) delete mode 100644 libavcodec/codec2utils.c diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 5b41450b86..c11645616d 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -978,9 +978,6 @@ OBJS-$(CONFIG_VP8_QSV_HWACCEL) += qsvdec.o OBJS-$(CONFIG_ISO_MEDIA) += mpeg4audio.o mpegaudiodata.o OBJS-$(CONFIG_ADTS_MUXER) += mpeg4audio.o -OBJS-$(CONFIG_CODEC2_DEMUXER) += codec2utils.o -OBJS-$(CONFIG_CODEC2_MUXER) += codec2utils.o -OBJS-$(CONFIG_CODEC2RAW_DEMUXER) += codec2utils.o OBJS-$(CONFIG_DNXHD_DEMUXER) += dnxhddata.o OBJS-$(CONFIG_FITS_DEMUXER) += fits.o OBJS-$(CONFIG_LATM_MUXER) += mpeg4audio.o @@ -1023,8 +1020,8 @@ OBJS-$(CONFIG_LIBAOM_AV1_DECODER) += libaomdec.o OBJS-$(CONFIG_LIBAOM_AV1_ENCODER) += libaomenc.o OBJS-$(CONFIG_LIBARIBB24_DECODER) += libaribb24.o ass.o OBJS-$(CONFIG_LIBCELT_DECODER) += libcelt_dec.o -OBJS-$(CONFIG_LIBCODEC2_DECODER) += libcodec2.o codec2utils.o -OBJS-$(CONFIG_LIBCODEC2_ENCODER) += libcodec2.o codec2utils.o +OBJS-$(CONFIG_LIBCODEC2_DECODER) += libcodec2.o +OBJS-$(CONFIG_LIBCODEC2_ENCODER) += libcodec2.o OBJS-$(CONFIG_LIBDAV1D_DECODER) += libdav1d.o OBJS-$(CONFIG_LIBDAVS2_DECODER) += libdavs2.o OBJS-$(CONFIG_LIBFDK_AAC_DECODER) += libfdk-aacdec.o diff --git a/libavcodec/codec2utils.c b/libavcodec/codec2utils.c deleted file mode 100644 index a942662403..0000000000 --- a/libavcodec/codec2utils.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * codec2 utility functions - * Copyright (c) 2017 Tomas Härdin - * - * 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 -#include "internal.h" -#include "libavcodec/codec2utils.h" - -#if LIBAVCODEC_VERSION_MAJOR < 59 -int avpriv_codec2_mode_bit_rate(void *logctx, int mode) -{ - int frame_size = avpriv_codec2_mode_frame_size(logctx, mode); - int block_align = avpriv_codec2_mode_block_align(logctx, mode); - - if (frame_size <= 0 || block_align <= 0) { - return 0; - } - - return 8 * 8000 * block_align / frame_size; -} - -int avpriv_codec2_mode_frame_size(void *logctx, int mode) -{ - int frame_size_table[CODEC2_MODE_MAX+1] = { - 160, // 3200 - 160, // 2400 - 320, // 1600 - 320, // 1400 - 320, // 1300 - 320, // 1200 - 320, // 700 - 320, // 700B - 320, // 700C - }; - - if (mode < 0 || mode > CODEC2_MODE_MAX) { - av_log(logctx, AV_LOG_ERROR, "unknown codec2 mode %i, can't find frame_size\n", mode); - return 0; - } else { - return frame_size_table[mode]; - } -} - -int avpriv_codec2_mode_block_align(void *logctx, int mode) -{ - int block_align_table[CODEC2_MODE_MAX+1] = { - 8, // 3200 - 6, // 2400 - 8, // 1600 - 7, // 1400 - 7, // 1300 - 6, // 1200 - 4, // 700 - 4, // 700B - 4, // 700C - }; - - if (mode < 0 || mode > CODEC2_MODE_MAX) { - av_log(logctx, AV_LOG_ERROR, "unknown codec2 mode %i, can't find block_align\n", mode); - return 0; - } else { - return block_align_table[mode]; - } -} -#endif diff --git a/libavcodec/codec2utils.h b/libavcodec/codec2utils.h index 37f0693dc7..6812ae895c 100644 --- a/libavcodec/codec2utils.h +++ b/libavcodec/codec2utils.h @@ -24,8 +24,6 @@ #include -#include "version.h" - //Highest mode we're willing to use. //Don't want to let users accidentally produce files that can't be decoded in the future. //CODEC2_MODE_WB (9) is experimental/unstable as of 2017-11-23. @@ -47,22 +45,6 @@ { "700B", "700B", 0, AV_OPT_TYPE_CONST, {.i64 = 7}, .flags=option_flags, .unit="codec2_mode"},\ { "700C", "700C", 0, AV_OPT_TYPE_CONST, {.i64 = 8}, .flags=option_flags, .unit="codec2_mode"} -#if LIBAVCODEC_VERSION_MAJOR < 59 -//The three following functions are here to avoid needing libavformat/codec2.c to depend on libcodec2 - -//Computes bitrate from mode, with frames rounded up to the nearest octet. -//So 700 bit/s (28 bits/frame) becomes 800 bits/s (32 bits/frame). -//logctx is used for av_log() -//Returns <0 if mode is invalid -int avpriv_codec2_mode_bit_rate(void *logctx, int mode); - -//Mimics codec2_samples_per_frame() -int avpriv_codec2_mode_frame_size(void *logctx, int mode); - -//Mimics (codec2_bits_per_frame()+7)/8 -int avpriv_codec2_mode_block_align(void *logctx, int mode); -#endif - #define CODEC2_EXTRADATA_SIZE 4 //Used in codec2raw demuxer and libcodec2 encoder