From patchwork Fri Jan 29 05:22: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: 25244 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id F07BD44AFC4 for ; Fri, 29 Jan 2021 07:23:33 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BA168689BEC; Fri, 29 Jan 2021 07:23:33 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 60B0F680901 for ; Fri, 29 Jan 2021 07:23:27 +0200 (EET) Received: by mail-wr1-f41.google.com with SMTP id c12so7589052wrc.7 for ; Thu, 28 Jan 2021 21:23:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5RK6330RB1rOnts9uS5hb75tI3wu03WKemCbr+JE6ww=; b=j2nrJJWB4I91CWhZEUHlwTcbJSyCTFo/5SFepQ9HUHeEpAbBsHPUy0V1eEpyUEwcBP h674gqVbF/6EGCAlwel050/HIgvnjgOX+eJzihr+HrEYwbRZg2mUrp443t5UlhLBEwTA kNOcHEq47hZPhnz/E1SISviQTj/JGeY+xVSAHXHTVzBnNQKvE9xllaXo5QvkEC2J5PY7 Sce6d0KqqivFowuwcoAX6vxqccKqnIdM/0Ctxco+XXmkWd66YFLwQ0Zi7QwHpnQx2k0V 2w13+sm6puM9BTAepVKc306Qf9NhjAaAM/obyoAzte06roJj/ik0TSe36XNbTxef3p2n kiig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5RK6330RB1rOnts9uS5hb75tI3wu03WKemCbr+JE6ww=; b=JM3YzAKVpRK7tC9QE9FBxMBSTOBQUyWudMj5IR9oD4sQlxQBCRUWo7rfeZiOKADg1Y pDgMx7x63eIV8TU6hKBtAVqT903/tSU4wlXdq9RTL1mkH8bhUnWFgl19Dx6aZksL1SCu RWo3OnHG/EMXQD7Xotf3qluwHQPJecKH6FhQx0hKnRe8+ArGRW2IvYFjlg+/eP6M/5Tx U1dzwHByYJyl8JUxEdGoQMeKKWI3cATxvdrjj3ici2yy4qN1dVAdGQhI3ldPMe2Yc2cJ UdwYS5cPsGdEF+cPXL9HwHoER+fjegN1nF3o0lopkMV2QOng3PRuQnoDP0WdAg5H/GNx RhvQ== X-Gm-Message-State: AOAM533Qc0o+SYGsZdyPgtMaCL8o2bby8OCArh+fe7B4Y8puFXxmcR1o 0dpxsBK3B0Rk4izgceVTRmzu4jEWVBA= X-Google-Smtp-Source: ABdhPJxatuupusDEyV9oPuU6bxu6pauh21a9vWakPllAfNj1nmLwzTRQBYhYuZvXKP2hkkh08PlgiA== X-Received: by 2002:adf:dd05:: with SMTP id a5mr2450397wrm.402.1611897806586; Thu, 28 Jan 2021 21:23:26 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id d13sm10068611wrx.93.2021.01.28.21.23.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 21:23:26 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 29 Jan 2021 06:22:50 +0100 Message-Id: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 01/13] avfilter/drawutils: Remove remnants of old API X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" ff_fill_line_with_color and ff_draw_rectangle are unused since 19c8f2271423281c9b876b984076a6467c455904; ff_copy_rectangle is unused since 53b7a3fe081ec56c5706228eb6431bb943ad471a. Signed-off-by: Andreas Rheinhardt --- libavfilter/drawutils.c | 98 ----------------------------------------- libavfilter/drawutils.h | 13 ------ 2 files changed, 111 deletions(-) diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c index 5f4cb548f0..71fe25692c 100644 --- a/libavfilter/drawutils.c +++ b/libavfilter/drawutils.c @@ -77,104 +77,6 @@ int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt) return 0; } -int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w, uint8_t dst_color[4], - enum AVPixelFormat pix_fmt, uint8_t rgba_color[4], - int *is_packed_rgba, uint8_t rgba_map_ptr[4]) -{ - uint8_t rgba_map[4] = {0}; - int i; - const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt); - int hsub; - - av_assert0(pix_desc); - - hsub = pix_desc->log2_chroma_w; - - *is_packed_rgba = ff_fill_rgba_map(rgba_map, pix_fmt) >= 0; - - if (*is_packed_rgba) { - pixel_step[0] = (av_get_bits_per_pixel(pix_desc))>>3; - for (i = 0; i < 4; i++) - dst_color[rgba_map[i]] = rgba_color[i]; - - line[0] = av_malloc_array(w, pixel_step[0]); - if (!line[0]) - return AVERROR(ENOMEM); - for (i = 0; i < w; i++) - memcpy(line[0] + i * pixel_step[0], dst_color, pixel_step[0]); - if (rgba_map_ptr) - memcpy(rgba_map_ptr, rgba_map, sizeof(rgba_map[0]) * 4); - } else { - int plane; - - dst_color[0] = RGB_TO_Y_CCIR(rgba_color[0], rgba_color[1], rgba_color[2]); - dst_color[1] = RGB_TO_U_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0); - dst_color[2] = RGB_TO_V_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0); - dst_color[3] = rgba_color[3]; - - for (plane = 0; plane < 4; plane++) { - int line_size; - int hsub1 = (plane == 1 || plane == 2) ? hsub : 0; - - pixel_step[plane] = 1; - line_size = AV_CEIL_RSHIFT(w, hsub1) * pixel_step[plane]; - line[plane] = av_malloc(line_size); - if (!line[plane]) { - while(plane && line[plane-1]) - av_freep(&line[--plane]); - return AVERROR(ENOMEM); - } - memset(line[plane], dst_color[plane], line_size); - } - } - - return 0; -} - -void ff_draw_rectangle(uint8_t *dst[4], int dst_linesize[4], - uint8_t *src[4], int pixelstep[4], - int hsub, int vsub, int x, int y, int w, int h) -{ - int i, plane; - uint8_t *p; - - for (plane = 0; plane < 4 && dst[plane]; plane++) { - int hsub1 = plane == 1 || plane == 2 ? hsub : 0; - int vsub1 = plane == 1 || plane == 2 ? vsub : 0; - int width = AV_CEIL_RSHIFT(w, hsub1); - int height = AV_CEIL_RSHIFT(h, vsub1); - - p = dst[plane] + (y >> vsub1) * dst_linesize[plane]; - for (i = 0; i < height; i++) { - memcpy(p + (x >> hsub1) * pixelstep[plane], - src[plane], width * pixelstep[plane]); - p += dst_linesize[plane]; - } - } -} - -void ff_copy_rectangle(uint8_t *dst[4], int dst_linesize[4], - uint8_t *src[4], int src_linesize[4], int pixelstep[4], - int hsub, int vsub, int x, int y, int y2, int w, int h) -{ - int i, plane; - uint8_t *p; - - for (plane = 0; plane < 4 && dst[plane]; plane++) { - int hsub1 = plane == 1 || plane == 2 ? hsub : 0; - int vsub1 = plane == 1 || plane == 2 ? vsub : 0; - int width = AV_CEIL_RSHIFT(w, hsub1); - int height = AV_CEIL_RSHIFT(h, vsub1); - - p = dst[plane] + (y >> vsub1) * dst_linesize[plane]; - for (i = 0; i < height; i++) { - memcpy(p + (x >> hsub1) * pixelstep[plane], - src[plane] + src_linesize[plane]*(i+(y2>>vsub1)), width * pixelstep[plane]); - p += dst_linesize[plane]; - } - } -} - int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format); diff --git a/libavfilter/drawutils.h b/libavfilter/drawutils.h index b999d70e55..2ca2475585 100644 --- a/libavfilter/drawutils.h +++ b/libavfilter/drawutils.h @@ -30,19 +30,6 @@ int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt); -int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w, - uint8_t dst_color[4], - enum AVPixelFormat pix_fmt, uint8_t rgba_color[4], - int *is_packed_rgba, uint8_t rgba_map[4]); - -void ff_draw_rectangle(uint8_t *dst[4], int dst_linesize[4], - uint8_t *src[4], int pixelstep[4], - int hsub, int vsub, int x, int y, int w, int h); - -void ff_copy_rectangle(uint8_t *dst[4], int dst_linesize[4], - uint8_t *src[4], int src_linesize[4], int pixelstep[4], - int hsub, int vsub, int x, int y, int y2, int w, int h); - #define MAX_PLANES 4 typedef struct FFDrawContext { From patchwork Fri Jan 29 05:22: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: 25249 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 7690C44B9D9 for ; Fri, 29 Jan 2021 07:33:47 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5993C68A77A; Fri, 29 Jan 2021 07:33:47 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 67462680A68 for ; Fri, 29 Jan 2021 07:33:41 +0200 (EET) Received: by mail-ej1-f41.google.com with SMTP id kg20so11235891ejc.4 for ; Thu, 28 Jan 2021 21:33:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CAJ9dv4ewUZKVvjGG10PHhPUE8ruIZx1FVOfdwC/ywU=; b=fhjJ5blxzlEt1RLuPyQFJIfCvDhHnlEI6nQLDMsuyAUINRl9tpnBJH7cm7u22xZYjh JmY0+o7OZzpTvcwuzpfGhdCigLUAkyqWKwrqxlxsdH+I2tUo8vuL/gjgT4HFBlTiJBdI 5Z7xt3hw9n9oou5phF/GVbcyrppXSWlDi0CeVGQuDhR8sT3KG+k09A753p5dVZ/Yg0x1 WYR1gRBNsSKqiKDp0wqT7rrLFoaKWFJ61hTzzCgVL1LQK0cp5mDGrEzEqZJtRHXIumnn D/J4fwlZxjauKRkgUB8rClJH2pF7I9JVfStfaYpqz0A/XjFRlWMaJC2GmxaBTH+1LPbx fjbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CAJ9dv4ewUZKVvjGG10PHhPUE8ruIZx1FVOfdwC/ywU=; b=n8agEPjuTerQXOBvtAh7DyFuJyJOSKyTUZxAok29BvvWkru4P0RuR3QkzLZhlTZ75M k5spcpEPyf2q1ZbxDS6tgf+7XiFdy6zFnzVOEXVg0Jyyczv3IPPe9MZAeWH0uilPKtNp d2+W7xH77GU2LR51w22MrAXPg0F+tMAqPF8tyBgrSv3VVlaNWlA++NiCKStb5Tsomwl/ HZKItPVNDlf4Osd7PJvXoHACvqJS686Qv9P8DKXbmwIXc4qX81GLkzz/1BaEGmTtw+nT ZlJF3cfhrkcPaluFR6ZF2JHHSdWMCLMgX0eLSptLHwnBuzHvChCLZKlhu5SIYoS0am/O CkVw== X-Gm-Message-State: AOAM532Zobgo2xSscpg4+hXLRd263lrBI7ASSgbUdFUZTt+718VGFnqq jTH/fPXzH7WG3yL/UiVKesFXwhUzUao= X-Google-Smtp-Source: ABdhPJwlJHMiGtcjkcXbGxt0zL+HRKfy1JzJKm3mLylRWegfhCJcwPzLbp7vBe6pdKwvPlv5tbdEGw== X-Received: by 2002:a5d:6510:: with SMTP id x16mr2369342wru.175.1611897975908; Thu, 28 Jan 2021 21:26:15 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id d13sm10068611wrx.93.2021.01.28.21.26.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 21:26:15 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 29 Jan 2021 06:22:51 +0100 Message-Id: <20210129052302.3124447-2-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> References: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 02/13] avcodec/fft_template: Avoid useless function X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" ff_init_ff_cos_tabs is only used for the floating point FFT and only if hardcoded tables are disabled. Signed-off-by: Andreas Rheinhardt --- libavcodec/fft.h | 16 ++++++++-------- libavcodec/fft_template.c | 10 ++++------ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/libavcodec/fft.h b/libavcodec/fft.h index 5ca2d18432..e03ca01abf 100644 --- a/libavcodec/fft.h +++ b/libavcodec/fft.h @@ -109,8 +109,16 @@ struct FFTContext { #if CONFIG_HARDCODED_TABLES #define COSTABLE_CONST const +#define ff_init_ff_cos_tabs(index) #else #define COSTABLE_CONST +#define ff_init_ff_cos_tabs FFT_NAME(ff_init_ff_cos_tabs) + +/** + * Initialize the cosine table in ff_cos_tabs[index] + * @param index index in ff_cos_tabs array of the table to initialize + */ +void ff_init_ff_cos_tabs(int index); #endif #define COSTABLE(size) \ @@ -132,14 +140,6 @@ extern COSTABLE(65536); extern COSTABLE(131072); extern COSTABLE_CONST FFTSample* const FFT_NAME(ff_cos_tabs)[18]; -#define ff_init_ff_cos_tabs FFT_NAME(ff_init_ff_cos_tabs) - -/** - * Initialize the cosine table in ff_cos_tabs[index] - * @param index index in ff_cos_tabs array of the table to initialize - */ -void ff_init_ff_cos_tabs(int index); - #define ff_fft_init FFT_NAME(ff_fft_init) #define ff_fft_end FFT_NAME(ff_fft_end) diff --git a/libavcodec/fft_template.c b/libavcodec/fft_template.c index 2d05990ca9..3012372a74 100644 --- a/libavcodec/fft_template.c +++ b/libavcodec/fft_template.c @@ -113,6 +113,10 @@ static CosTabsInitOnce cos_tabs_init_once[] = { { init_ff_cos_tabs_131072, AV_ONCE_INIT }, }; +av_cold void ff_init_ff_cos_tabs(int index) +{ + ff_thread_once(&cos_tabs_init_once[index].control, cos_tabs_init_once[index].func); +} #endif COSTABLE_CONST FFTSample * const FFT_NAME(ff_cos_tabs)[] = { NULL, NULL, NULL, NULL, @@ -148,12 +152,6 @@ static int split_radix_permutation(int i, int n, int inverse) else return split_radix_permutation(i, m, inverse)*4 - 1; } -av_cold void ff_init_ff_cos_tabs(int index) -{ -#if (!CONFIG_HARDCODED_TABLES) && (!FFT_FIXED_32) - ff_thread_once(&cos_tabs_init_once[index].control, cos_tabs_init_once[index].func); -#endif -} static const int avx_tab[] = { 0, 4, 1, 5, 8, 12, 9, 13, 2, 6, 3, 7, 10, 14, 11, 15 From patchwork Fri Jan 29 05:22: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: 25250 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 230ED44B9D9 for ; Fri, 29 Jan 2021 07:33:58 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 04C1468A75A; Fri, 29 Jan 2021 07:33:58 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2C330680378 for ; Fri, 29 Jan 2021 07:33:51 +0200 (EET) Received: by mail-wm1-f44.google.com with SMTP id o10so6332126wmc.1 for ; Thu, 28 Jan 2021 21:33:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eGtAG344w9T/s389NLPPskvCZKhGAJKXiY4tc16dH+g=; b=cUBKLBl7Sy8KjUhVJmNJuxd8KJu+D9/AdbVKjvFvhM0ySILrLnPf+YDA0p/S/wnWdC 9kYKfyJdA3Y8z0reX0uQEq0M1ftZKT9WoThiCnMlJIVUPTw9cQk7PCglYzTnxIrVVn8j 21SGWXdY72DZR8gxlXMcM25BSUmjehN5I1IKpPBTx4V6QSyYxLUfscutnCBB3BkZVio7 M4U9RI3qFND3bhDEQU/hRDsjnzCu2wzD2j85R9xxPPkrcQoiGpjGoLgf63A1mmN9QzbP 277qnHsjPPi2avvKaKzLhQaje3BanKTbxH+B6Po9vXg5ndJzT2ETdoqNXEb8t6TgpkKH iZ3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eGtAG344w9T/s389NLPPskvCZKhGAJKXiY4tc16dH+g=; b=uFS1TlAiFBAyleC+q9bVBSrsqFFT55kMAFRBN5x+2Tp/vvuE5yeO0NDMgkcwrOVi2l /jQQMsKnO0uVMfhk4aHvjsnUywzWd8LraiWV2Hc6N8RVgQXx8v/NKE6H6EyHjPS25wHv GjFmWCUUGY6/ikIejZmW6iXEvMqGtXtKTThUZFyJSIodKZjndPNk0ZDvSZVk2aP1wRCk 7HwkcqAuTD6VEQkQ+xYedmrdA+LivLD1yyjO1fXf7/5ly9b0EpetyPYN2fNldIb9mMnR qooP4hKUpudYSQrefow3F3VSxcYWruI6xXnasid0rQxMQK4mNEBJHxh2ueJ6/lSgqp4h 21sw== X-Gm-Message-State: AOAM530qxLbp5//Rnda3Fiys/IEyKw60AO1fiKL81BPcNiSHerfWhZ8e KVRsbBR+j04JJuT9SjAfmxqaNxIfI7Q= X-Google-Smtp-Source: ABdhPJxIUvMKSRpsezPyBuTTCUdz+0/Tk7Bc6CWdH5FNX6q8N9l9mVV5dDJi4M30PB+LMZAc+VWlWw== X-Received: by 2002:a1c:f706:: with SMTP id v6mr2079811wmh.85.1611897976866; Thu, 28 Jan 2021 21:26:16 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id d13sm10068611wrx.93.2021.01.28.21.26.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 21:26:16 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 29 Jan 2021 06:22:52 +0100 Message-Id: <20210129052302.3124447-3-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> References: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 03/13] avcodec/vorbis_data: Move encoder-related table to its only user X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" Said table was unused in case libvorbis was disabled. Signed-off-by: Andreas Rheinhardt --- libavcodec/libvorbisenc.c | 13 ++++++++++++- libavcodec/vorbis.h | 1 - libavcodec/vorbis_data.c | 11 ----------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/libavcodec/libvorbisenc.c b/libavcodec/libvorbisenc.c index f78f872fe2..bf94764954 100644 --- a/libavcodec/libvorbisenc.c +++ b/libavcodec/libvorbisenc.c @@ -70,6 +70,17 @@ static const AVClass vorbis_class = { .version = LIBAVUTIL_VERSION_INT, }; +static const uint8_t vorbis_encoding_channel_layout_offsets[8][8] = { + { 0 }, + { 0, 1 }, + { 0, 2, 1 }, + { 0, 1, 2, 3 }, + { 0, 2, 1, 3, 4 }, + { 0, 2, 1, 4, 5, 3 }, + { 0, 2, 1, 5, 6, 4, 3 }, + { 0, 2, 1, 6, 7, 4, 5, 3 }, +}; + static int vorbis_error_to_averror(int ov_err) { switch (ov_err) { @@ -287,7 +298,7 @@ static int libvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, buffer = vorbis_analysis_buffer(&s->vd, samples); for (c = 0; c < channels; c++) { int co = (channels > 8) ? c : - ff_vorbis_encoding_channel_layout_offsets[channels - 1][c]; + vorbis_encoding_channel_layout_offsets[channels - 1][c]; memcpy(buffer[c], frame->extended_data[co], samples * sizeof(*buffer[c])); } diff --git a/libavcodec/vorbis.h b/libavcodec/vorbis.h index 98dd14f9d4..69ddbd2982 100644 --- a/libavcodec/vorbis.h +++ b/libavcodec/vorbis.h @@ -26,7 +26,6 @@ extern const float ff_vorbis_floor1_inverse_db_table[256]; extern const float * const ff_vorbis_vwin[8]; extern const uint8_t ff_vorbis_channel_layout_offsets[8][8]; -extern const uint8_t ff_vorbis_encoding_channel_layout_offsets[8][8]; extern const uint64_t ff_vorbis_channel_layouts[9]; typedef struct vorbis_floor1_entry { diff --git a/libavcodec/vorbis_data.c b/libavcodec/vorbis_data.c index 4dba6a8cd3..fd7e291de2 100644 --- a/libavcodec/vorbis_data.c +++ b/libavcodec/vorbis_data.c @@ -34,17 +34,6 @@ const uint8_t ff_vorbis_channel_layout_offsets[8][8] = { { 0, 2, 1, 7, 5, 6, 3, 4 }, }; -const uint8_t ff_vorbis_encoding_channel_layout_offsets[8][8] = { - { 0 }, - { 0, 1 }, - { 0, 2, 1 }, - { 0, 1, 2, 3 }, - { 0, 2, 1, 3, 4 }, - { 0, 2, 1, 4, 5, 3 }, - { 0, 2, 1, 5, 6, 4, 3 }, - { 0, 2, 1, 6, 7, 4, 5, 3 }, -}; - const uint64_t ff_vorbis_channel_layouts[9] = { AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, From patchwork Fri Jan 29 05:22: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: 25252 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 32E7944B9D9 for ; Fri, 29 Jan 2021 07:34:04 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1A77E68A7E6; Fri, 29 Jan 2021 07:34:04 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6EC2F6899DD for ; Fri, 29 Jan 2021 07:34:02 +0200 (EET) Received: by mail-wr1-f50.google.com with SMTP id v15so7626479wrx.4 for ; Thu, 28 Jan 2021 21:34:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3RB39mMAdkYvpoOBX1UUvrcr89dje3fnaGKoBr7MweM=; b=otB+FHhUelQ6Jd6OVY9QzWWS5sBlLeFdzngHRY2XycH1cA5sFU8eT/s3jcmmKG+wnn FsWgU6buq0lGAkSvEeEMEJuXLAAVKM+ET8xlGxYDODsz5GpQuRHcv4n3LMhQzooOhZ5c kp44Gik2xh8AQY2qlIlPsya2YxRD/MGIAep7mIiYNrBlqNmuDuARoCp5hPqfNMXyQcXe loVKJ1IEY292B2UjvSWSV7yx7Q1flbeDAjP7XyWDC90GDMTjQWm0+9seYLFTVj0D4Hpa jjGdrzJLJ1llgULBbH0SiMZi8PBGCbjHwwCCul84amIRnrpoSyyfZlQ+Ac6flySmHteS wiSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3RB39mMAdkYvpoOBX1UUvrcr89dje3fnaGKoBr7MweM=; b=JeA3z9WCoZn+OXGsuTMndIACnCffDNqYuU02iibPaMfvX1OZfSeVqQkaa6i75aFntH 6kgq2sjOQVoL4eEy5iVglJNF6IiKtGjnd3cSo2jwVxmdXkCqfm7hYR9lw8ClkgVTVlB7 9kiYN8Mp9HxmogENCYrgBpn0oAfNRD732J7c/34kueHyqnvtLIYftqzzem9ybksli/9Y s8S/oFV4vkaHxvF580MRBxDQYnQEGlrgrK3IGy9gozct0cxnTF1fVLWoSDpjWp/WpXq3 sUAnz/BNOkrfY/VunNYN6iGeZk3vFLkuFrbZHgeg+FGKOEAKIiRpkvcKJ82JfNriXb0p y4lg== X-Gm-Message-State: AOAM532vGspI6gDc2ZcoaoFyQach+z/SOSNCyC84LUXPwmBBkVg1H+0S I5JCj2R2zaoTLcrhqNUQNVKjH6vqXAA= X-Google-Smtp-Source: ABdhPJwa/R5kSTcT1pHKr8qFxi2E4wUPwTwuRseOCavKm3qiKYzEZYFIsoMMDk+NdRFjECnki/KUlw== X-Received: by 2002:a05:6000:1189:: with SMTP id g9mr2514031wrx.230.1611897977869; Thu, 28 Jan 2021 21:26:17 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id d13sm10068611wrx.93.2021.01.28.21.26.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 21:26:17 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 29 Jan 2021 06:22:53 +0100 Message-Id: <20210129052302.3124447-4-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> References: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 04/13] avformat/rtmppkt: Remove ff_amf_read_bool X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" Added in 50468f93e3940ba78836dfdac5165c20ae75327a, but never used. Signed-off-by: Andreas Rheinhardt --- libavformat/rtmppkt.c | 8 -------- libavformat/rtmppkt.h | 9 --------- 2 files changed, 17 deletions(-) diff --git a/libavformat/rtmppkt.c b/libavformat/rtmppkt.c index 1eeae17337..0e61e83699 100644 --- a/libavformat/rtmppkt.c +++ b/libavformat/rtmppkt.c @@ -84,14 +84,6 @@ void ff_amf_write_object_end(uint8_t **dst) bytestream_put_be24(dst, AMF_DATA_TYPE_OBJECT_END); } -int ff_amf_read_bool(GetByteContext *bc, int *val) -{ - if (bytestream2_get_byte(bc) != AMF_DATA_TYPE_BOOL) - return AVERROR_INVALIDDATA; - *val = bytestream2_get_byte(bc); - return 0; -} - int ff_amf_read_number(GetByteContext *bc, double *val) { uint64_t read; diff --git a/libavformat/rtmppkt.h b/libavformat/rtmppkt.h index eb68f1d3e1..a15d2a5773 100644 --- a/libavformat/rtmppkt.h +++ b/libavformat/rtmppkt.h @@ -259,15 +259,6 @@ void ff_amf_write_field_name(uint8_t **dst, const char *str); */ void ff_amf_write_object_end(uint8_t **dst); -/** - * Read AMF boolean value. - * - *@param[in,out] gbc GetByteContext initialized with AMF-formatted data - *@param[out] val 0 or 1 - *@return 0 on success or an AVERROR code on failure -*/ -int ff_amf_read_bool(GetByteContext *gbc, int *val); - /** * Read AMF number value. * From patchwork Fri Jan 29 05:22: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: 25247 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id D796844B8DE for ; Fri, 29 Jan 2021 07:32:21 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C141468A76A; Fri, 29 Jan 2021 07:32:21 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 475EF68A767 for ; Fri, 29 Jan 2021 07:32:15 +0200 (EET) Received: by mail-wm1-f43.google.com with SMTP id m2so5916554wmm.1 for ; Thu, 28 Jan 2021 21:32:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OnwmqJoNDwepJGiWlIReMCzg22Q2i0/ayhCkwlaxcqg=; b=IjOmtRre4yKRK3Vf7gPm2JD75/KcM7PNxG8RnQvXfLJYMgzfo+yX2OzDGoCBlcyC/G 8wuvkvHaZXTqarUATRqUwTjlKFhwz3bDvxGXDV/wuQYxFAG+V0d1JxMCRfQxp+FEkYdQ kdjb+YAH3KwUraFYHYfVTeExQiDG5PA1tf8LMW4g+EbG5ppWlCwbGqf3XMFtjP2aNPjQ RZ4r333PRkLv6j+XTaqKfaoM8x4ZPxB0IXPAcd1Z/jp1gQyD+8CapzaSaKLvxIFwuDHe PguGxA2Cp3IPylZH1dMaBA6J3tbbyGZ7CGjRtCJqtqJU9tDgrng3P6fy7/2YVSdrf0De Sdhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OnwmqJoNDwepJGiWlIReMCzg22Q2i0/ayhCkwlaxcqg=; b=ASbGVv2hglmyi8+in6viVzjFFvBaZ+1ISdIfZ6Di5R8sTkh2dqMRHi6gWlc8fOjAQX Pg3pKJykvzpgKXu+5hIpCDHu7QQEHHyG/M1rMzBrP9BYQ6e9URTc/Plfm8Hzc68L07TP BXJ7D3O6LiumywFakCE8RiAYsiohJr6rineTgDe1zbHJ+EbTEY7Vfcst3JbABbqPkcVM fkICePCeTGjPsvtnB+7jLxTzXxjTRswNZ7eEClvKq/YtsJk4g0bxyoaYYCE2dyL7rl8V UZwYQjhXQxg7TBiKY+MN4bSER/eC4v5V1PhAD5BbAEcmfiOmnJq5hhR5Z7OgEQrAAaxZ mM3g== X-Gm-Message-State: AOAM532VJsCIu5ciqbB2+T8cWruwHekvJACDgjLjhqKgCVO8ZtStjvKJ DZkMFLSFkLPwf0ecRCiiMUiP5t4AnWc= X-Google-Smtp-Source: ABdhPJxXrYh1uMwEJLnId4mj0kNOijxLWC2aYw+ZsFvC0+DbfQk5J7w0uJImHFaik0SU26XI0ymLHg== X-Received: by 2002:a1c:ac86:: with SMTP id v128mr2094889wme.76.1611897978893; Thu, 28 Jan 2021 21:26:18 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id d13sm10068611wrx.93.2021.01.28.21.26.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 21:26:18 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 29 Jan 2021 06:22:54 +0100 Message-Id: <20210129052302.3124447-5-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> References: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 05/13] avformat/rtmpproto: Only include RTMP protocols that are enabled X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" Signed-off-by: Andreas Rheinhardt --- libavformat/rtmpproto.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index d9741bc622..5a540e3240 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -3119,7 +3119,8 @@ static const AVOption rtmp_options[] = { { NULL }, }; -#define RTMP_PROTOCOL(flavor) \ +#define RTMP_PROTOCOL_0(flavor) +#define RTMP_PROTOCOL_1(flavor) \ static const AVClass flavor##_class = { \ .class_name = #flavor, \ .item_name = av_default_item_name, \ @@ -3139,11 +3140,16 @@ const URLProtocol ff_##flavor##_protocol = { \ .flags = URL_PROTOCOL_FLAG_NETWORK, \ .priv_data_class= &flavor##_class, \ }; - - -RTMP_PROTOCOL(rtmp) -RTMP_PROTOCOL(rtmpe) -RTMP_PROTOCOL(rtmps) -RTMP_PROTOCOL(rtmpt) -RTMP_PROTOCOL(rtmpte) -RTMP_PROTOCOL(rtmpts) +#define RTMP_PROTOCOL_2(flavor, enabled) \ + RTMP_PROTOCOL_ ## enabled(flavor) +#define RTMP_PROTOCOL_3(flavor, config) \ + RTMP_PROTOCOL_2(flavor, config) +#define RTMP_PROTOCOL(flavor, uppercase) \ + RTMP_PROTOCOL_3(flavor, CONFIG_ ## uppercase ## _PROTOCOL) + +RTMP_PROTOCOL(rtmp, RTMP) +RTMP_PROTOCOL(rtmpe, RTMPE) +RTMP_PROTOCOL(rtmps, RTMPS) +RTMP_PROTOCOL(rtmpt, RTMPT) +RTMP_PROTOCOL(rtmpte, RTMPTE) +RTMP_PROTOCOL(rtmpts, RTMPTS) From patchwork Fri Jan 29 05:22: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: 25245 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 5A2E6449EBD for ; Fri, 29 Jan 2021 07:26:27 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2DA4A68A70F; Fri, 29 Jan 2021 07:26:27 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8B1086808F1 for ; Fri, 29 Jan 2021 07:26:20 +0200 (EET) Received: by mail-wm1-f45.google.com with SMTP id m1so2929959wml.2 for ; Thu, 28 Jan 2021 21:26:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=C08tFWzKPber90B0KY8BMwzXe9yLCyPeTXmtudl6g4Y=; b=XXrzbHrukYRJ7KJxjggA6AGfPPjzw9Qk+XPLk88jVzgpMza81aljs5MVTlyMZLqXDE y3Obak7Gh5ALjzXhKoHRvrday0elrOXbtz5RAfVArNCvOS0oK41vcFlkon5f7qXCHUei qeG4ub/ZkXz4qbKaTmdEPlvixkAnpzoaPlbOLsWX6e1KsTWiEZSD7aRhyVmMVNA+h4sP NFt+ekFcfE0bKmrsW9aYUGhRI/RxadAj/XRIDHvBZ7sjmNzkVRmCXdz8C4UVUvj61Ca3 hGFgWSp21zKY+qa6LpEdHnc95aPTplJr2rjm42yt0S8WTUKH2YKxI9SJurWHylJcnSPd Tj5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C08tFWzKPber90B0KY8BMwzXe9yLCyPeTXmtudl6g4Y=; b=Dr0CXTIT+dieCPMvqkXdiub2U99H0jAowp6IQ5HgCO06MWeBk7/EJO4fUAlwg+KZmC 0EjiCpwscL2jzP7oUn55Rys5CgoGOXu9PVAOQNG8Ebe4xZBuks1QE5Tcv7F2IuJtICKU rbAN6E8becwESrxNIBkp/Eektz4zD7F3p7EXx7LPF0FWa6Gh0nNBN+5S/POtyE5QwYX0 lmMxtDnJQ6zF76fQvD3WbYc87PoPFR+kSfaAbZiKuRL06crNiOVmZXd1Bob0djeXBA58 TD79Ya/tVf2/OXwaNqRG/cEZ1FPxxlwJh3cOaQXsUE9CjlC/+OfbFgVJlUEz7XZObf4Y JPVw== X-Gm-Message-State: AOAM533F+h5t0uY4QsfqblQAirVDCCMON95OqBN7rTU1P+j+6wPMH/z+ ZkJCNMQBJTilk3pMLY0AkJ3DGDycG1E= X-Google-Smtp-Source: ABdhPJxsRixl/jQTrn66GAQx5lXOf5CqItiaqgPuAiJWWGVxJxDwcspZBdYRDAJ1Rd3VaXWVyQtUQg== X-Received: by 2002:a7b:c08f:: with SMTP id r15mr2141821wmh.22.1611897979761; Thu, 28 Jan 2021 21:26:19 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id d13sm10068611wrx.93.2021.01.28.21.26.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 21:26:19 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 29 Jan 2021 06:22:55 +0100 Message-Id: <20210129052302.3124447-6-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> References: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 06/13] avformat/avio: Remove ffurl_open X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" It is only used in commented-out (and nonworking) code in async.c. Signed-off-by: Andreas Rheinhardt --- libavformat/async.c | 6 ++++-- libavformat/avio.c | 7 ------- libavformat/url.h | 7 ++----- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/libavformat/async.c b/libavformat/async.c index cc11ec47a0..5a81507ef1 100644 --- a/libavformat/async.c +++ b/libavformat/async.c @@ -612,7 +612,8 @@ int main(void) /* * test normal read */ - ret = ffurl_open(&h, "async:async-test:", AVIO_FLAG_READ, NULL, NULL); + ret = ffurl_open_whitelist(&h, "async:async-test:", AVIO_FLAG_READ, + NULL, NULL, NULL, NULL, NULL); printf("open: %d\n", ret); size = ffurl_size(h); @@ -688,7 +689,8 @@ int main(void) */ ffurl_close(h); av_dict_set_int(&opts, "async-test-read-error", -10000, 0); - ret = ffurl_open(&h, "async:async-test:", AVIO_FLAG_READ, NULL, &opts); + ret = ffurl_open_whitelist(&h, "async:async-test:", AVIO_FLAG_READ, + NULL, &opts, NULL, NULL, NULL); printf("open: %d\n", ret); ret = ffurl_read(h, buf, 1); diff --git a/libavformat/avio.c b/libavformat/avio.c index 3886ed7a90..fbe07e44bc 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -354,13 +354,6 @@ fail: return ret; } -int ffurl_open(URLContext **puc, const char *filename, int flags, - const AVIOInterruptCB *int_cb, AVDictionary **options) -{ - return ffurl_open_whitelist(puc, filename, flags, - int_cb, options, NULL, NULL, NULL); -} - static inline int retry_transfer_wrapper(URLContext *h, uint8_t *buf, int size, int size_min, int (*transfer_func)(URLContext *h, diff --git a/libavformat/url.h b/libavformat/url.h index 1ef5ca35d5..f13e851a14 100644 --- a/libavformat/url.h +++ b/libavformat/url.h @@ -56,8 +56,8 @@ typedef struct URLProtocol { int (*url_open)( URLContext *h, const char *url, int flags); /** * This callback is to be used by protocols which open further nested - * protocols. options are then to be passed to ffurl_open()/ffurl_connect() - * for those nested protocols. + * protocols. options are then to be passed to ffurl_open_whitelist() + * or ffurl_connect() for those nested protocols. */ int (*url_open2)(URLContext *h, const char *url, int flags, AVDictionary **options); int (*url_accept)(URLContext *s, URLContext **c); @@ -148,9 +148,6 @@ int ffurl_open_whitelist(URLContext **puc, const char *filename, int flags, const char *whitelist, const char* blacklist, URLContext *parent); -int ffurl_open(URLContext **puc, const char *filename, int flags, - const AVIOInterruptCB *int_cb, AVDictionary **options); - /** * Accept an URLContext c on an URLContext s * From patchwork Fri Jan 29 05:22: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: 25254 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 19CAD44B9EE for ; Fri, 29 Jan 2021 07:34:13 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EBDAB68A874; Fri, 29 Jan 2021 07:34:12 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CD1D768A76A for ; Fri, 29 Jan 2021 07:34:07 +0200 (EET) Received: by mail-ej1-f41.google.com with SMTP id hs11so11236933ejc.1 for ; Thu, 28 Jan 2021 21:34:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qvAYjlZWnNbEhWMBo6zFF8wHV8cqZwwh+TcrFox/0wY=; b=QQlWgnYwqc/3go2yZAcNQWo4FwvwpCyEPA+whfeMnUcwMp9bdEx1JNzMubkqeSC6wL 9Q5WKSqDP6L4CI3pOD9bMggOlZzeplcN21qNTZBDTDWZHtAT7J+3eU/rdX529eSrQxm8 CfCb8GIRBdljxxR8YmJVInhgiRY5kzyJ6msXv84LlwjRHQ0JfuK6+8aYhm1AJKVPcpW4 +/I9EgxLnluTA9Iv9k6nF489Mno7vt6PF3JlOD8tTDaWs+RlKzhHJp4rBu0R383kQZy3 Caa0ZPSu58eV1WOsg1oK4afA1bpDOVb1QoFXR1vqQMN406HLDWsYkW6tTJTBCA1zCcc+ dSVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qvAYjlZWnNbEhWMBo6zFF8wHV8cqZwwh+TcrFox/0wY=; b=l3vMo6vMrHhhTnx/Y7ALf6j5fNPAOJ1S43eq6KvuxFk66wrys8sV2HvQeJSGnN8LfN TYKAfsiukXsOhLFMv6g5ksaahoeM6rNo5Fja/U6AMx8iVvmzDu7shDkCs608WwUXVgE9 qKcqTjAl3KKSIvb2T7flsGD0Yy5Ijw8blxQF6MIsrtLy7Xxta2eenlLc8KCA+AjWPW/b w1MOUOHS8pjbvcIvmV1wWqqfz8zjjuXIR9bhFiXYExxF+nsdkUiYcrq0v4iGLj7ymQhg sS05ih2YpZzVow/VXuC8/ZxO4G1YBPcER+UPZCwSWDfxYq4w19DKJ7YodsXMrAyRAbaH Gmow== X-Gm-Message-State: AOAM531RdfW6c4GoJUWyPR/L2rM3hStOHqTeZQRDG+P67O0lRpVouZun smYipVpxiaiv49fzkHJyyLlU09+7lWU= X-Google-Smtp-Source: ABdhPJzy5AsaCgFzAHdVhaejEcnsX+NkiK2LB7GhXfHfMICNf4L5hoE8dWd8kSERIfvADnr+jfPmNQ== X-Received: by 2002:a5d:6311:: with SMTP id i17mr2441773wru.195.1611897980621; Thu, 28 Jan 2021 21:26:20 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id d13sm10068611wrx.93.2021.01.28.21.26.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 21:26:20 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 29 Jan 2021 06:22:56 +0100 Message-Id: <20210129052302.3124447-7-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> References: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 07/13] avformat/rtmppkt: Only compile ff_rtmp_packet_dump if defined(DEBUG) X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" It is only used in this case. Signed-off-by: Andreas Rheinhardt --- libavformat/rtmppkt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/rtmppkt.c b/libavformat/rtmppkt.c index 0e61e83699..00eb0873b2 100644 --- a/libavformat/rtmppkt.c +++ b/libavformat/rtmppkt.c @@ -561,6 +561,7 @@ int ff_amf_get_field_value(const uint8_t *data, const uint8_t *data_end, return amf_get_field_value2(&gb, name, dst, dst_size); } +#ifdef DEBUG static const char* rtmp_packet_type(int type) { switch (type) { @@ -677,6 +678,7 @@ void ff_rtmp_packet_dump(void *ctx, RTMPPacket *p) av_log(ctx, AV_LOG_DEBUG, "\n"); } } +#endif int ff_amf_match_string(const uint8_t *data, int size, const char *str) { From patchwork Fri Jan 29 05:22: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: 25256 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 0B87D44B31D for ; Fri, 29 Jan 2021 07:49:48 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CAA67689A01; Fri, 29 Jan 2021 07:49:47 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EC5746899DD for ; Fri, 29 Jan 2021 07:49:40 +0200 (EET) Received: by mail-lf1-f50.google.com with SMTP id e2so7232865lfj.13 for ; Thu, 28 Jan 2021 21:49:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=82aZqZ3q41Pkr/h6M+i8wDKlPhC56H8S+YT8xp8tt10=; b=El4i751nE8g5Qzxqd7UATGUx/pcOGQySBZ0bYUmkLdnisUOd+iO9RuEtzVXIaNL1tg ZZuQ5EZ1i2mIZ6i+hpDyqy9A9duZT5LJXP/pybN+eWQJHbP3TM/8wWNVKW+GpRzRUTQ+ LMxjVvHFDj4yBZodPYqGyLLOBVOP05LZJFQrP/EFSOdGevnGpgY+rmP9CePPc8ias+bD 7qQhGT7Au08e4+2P4lesImn7NRiZ1nbqmugL926yc+/9W9r28uxg5rH599HpxQ2llpLR 3yqsAWH0WR74HQI1w6tnC7XFs2ylb0+BYuW7a+Nb0KV86RdLv1MOSS9KhlFhfwGVQ6Oo EMww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=82aZqZ3q41Pkr/h6M+i8wDKlPhC56H8S+YT8xp8tt10=; b=Sy7BQrNXsHUy/m53rgJV0ck3sIwUuERJaiu2Fq6KutT+Vz7jKcPX1w0neDqnlAzo0L Qt5OFWKeZ9onuSQi8zlVINy6FwwzjKB/EAy9K5EXFrVTKxvXhS3+Dm3e9lTJ0WBdh5Dr lr7YahSB1b5154xQZK1OgryGaAeLPPpDdq+iWYdugBN5qiAm6k27ak9jg6JVN8BCepL0 4KAPQZ1wEZeDgLQjGJ7xFEHNEB4pntKRvvUVkUw3bCeANKtu1721utr/ubAvnu3r9kA0 Q8eUMcPykC826KriOanTIOvyfgx3FV52re9JhFOY6OQvRwAJiPM2warcmXDOFCnDA5P3 F1Ag== X-Gm-Message-State: AOAM530IzsszdAo0CQtFW2P1A77TZOCEg80lY15rDE7YU6x21gmXJ9x5 f4ltQKdmuqL41Vvh+EZ5NL8VyBcThYU= X-Google-Smtp-Source: ABdhPJxcfs/c7cxIBh3xnvIBn+a8j8bmVwxoG6RxzY6+Wbi1Vrna7dzIGZQfJQKOyw1XRYylSCEROA== X-Received: by 2002:a5d:4d08:: with SMTP id z8mr2533427wrt.240.1611897981599; Thu, 28 Jan 2021 21:26:21 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id d13sm10068611wrx.93.2021.01.28.21.26.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 21:26:21 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 29 Jan 2021 06:22:57 +0100 Message-Id: <20210129052302.3124447-8-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> References: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 08/13] fftools/ffmpeg_filter: Remove choose_sample_fmt X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" Unused since 6b35a83214f1bc3fb38c9ea9c2cd3676f28709fa. Signed-off-by: Andreas Rheinhardt --- fftools/ffmpeg.h | 1 - fftools/ffmpeg_filter.c | 23 ----------------------- 2 files changed, 24 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 8046e75026..6750432a81 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -652,7 +652,6 @@ int guess_input_channel_layout(InputStream *ist); enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *avctx, const AVCodec *codec, enum AVPixelFormat target); -void choose_sample_fmt(AVStream *st, const AVCodec *codec); int configure_filtergraph(FilterGraph *fg); int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out); diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index e9e31e043e..38e44d560b 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -91,29 +91,6 @@ enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *enc_ctx, return target; } -void choose_sample_fmt(AVStream *st, const AVCodec *codec) -{ - if (codec && codec->sample_fmts) { - const enum AVSampleFormat *p = codec->sample_fmts; - for (; *p != -1; p++) { - if (*p == st->codecpar->format) - break; - } - if (*p == -1) { - const AVCodecDescriptor *desc = avcodec_descriptor_get(codec->id); - if(desc && (desc->props & AV_CODEC_PROP_LOSSLESS) && av_get_sample_fmt_name(st->codecpar->format) > av_get_sample_fmt_name(codec->sample_fmts[0])) - av_log(NULL, AV_LOG_ERROR, "Conversion will not be lossless.\n"); - if(av_get_sample_fmt_name(st->codecpar->format)) - av_log(NULL, AV_LOG_WARNING, - "Incompatible sample format '%s' for codec '%s', auto-selecting format '%s'\n", - av_get_sample_fmt_name(st->codecpar->format), - codec->name, - av_get_sample_fmt_name(codec->sample_fmts[0])); - st->codecpar->format = codec->sample_fmts[0]; - } - } -} - static char *choose_pix_fmts(OutputFilter *ofilter) { OutputStream *ost = ofilter->ost; From patchwork Fri Jan 29 05:22: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: 25255 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 0E0C744B9EE for ; Fri, 29 Jan 2021 07:34:33 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E2C4D68A867; Fri, 29 Jan 2021 07:34:32 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6039568A898 for ; Fri, 29 Jan 2021 07:34:26 +0200 (EET) Received: by mail-lj1-f178.google.com with SMTP id e18so9114478lja.12 for ; Thu, 28 Jan 2021 21:34:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iOKZRJ+aDGVNXcfvQkY5ShZEllC0hAr4G6SBoVGIwKk=; b=kFgnYdVlpSHCYnI+VuYFhKksOoWQHbU7kpT9pluI4yFwBYYl3itetfKU0AmlbKm0x6 nCleQ7vi418seniNTH06U2Lu9zPRyeSwR1JZ9C+kreOl+bXFShfxxyW6L0q0tMBABbw/ vFQRk5fwzQ7yjvVLW6jMtdz+na+MYExPa/RhpYn3oVpYndNYorx0mdiT0SM5XAW/rKyq rXoOlfd+kDiLzM1vdtpKzNeZdC6+Pm87dDrX50v/X+L17zh1dCG+wR/w5/h6IhNdyIal rXXQxY2oF2yMkGb39Oor57RhNanMvYpgLX3Fee2p6m1A8qwjH36v4Ci2JCcu2OKXqHVK Qt6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iOKZRJ+aDGVNXcfvQkY5ShZEllC0hAr4G6SBoVGIwKk=; b=GzjPeMFR+7TMN2vDb2atNPfSa5b6S5qVn5zzwJwHcQyb/gCmyEthJpOO6Xtsql48hk UVDCZ8a0sSOCFtp7Sxksf3mhTARlF68wvEmDOZgraELgQ5ujReDlQ7ojnc9/UEy/quGy lSr956hRk/fc0hvOtPffa+/eGpGfnPJq8pDpAv2Rbb9FaXV44KG30535gFwx6iKbHysV 4eCiiPN17BnJVkB8KTlvTR/IAfAG1cTnTPLGx9okYc4aBOR1i/R7SBFQsBXzwOJnHEYe ajNcUxN+gXvQNQ6QiqMSofh5JHKX6eSUxRlBXuXcwXn7972RqUnhjhyZYJFsZyu2yoJE 3z5g== X-Gm-Message-State: AOAM5319ixdkgZlh9dVJtb0C3rEkyTsF/cATTuSmmFwXkmKNH4dG/dG2 w3q5tQKPjsHaV35iT/ORGWelGmmY17U= X-Google-Smtp-Source: ABdhPJynlzIT594PvKE70apNx0yBsoGOU7YHTDqo6itDMe9dlxGCbeAsvKjKL3Rwjp1ayykgcmSCBQ== X-Received: by 2002:a5d:6045:: with SMTP id j5mr2412298wrt.365.1611897982489; Thu, 28 Jan 2021 21:26:22 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id d13sm10068611wrx.93.2021.01.28.21.26.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 21:26:22 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 29 Jan 2021 06:22:58 +0100 Message-Id: <20210129052302.3124447-9-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> References: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 09/13] avfilter/ebur128: Remove unused functions X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" Also make a function only used here static. Signed-off-by: Andreas Rheinhardt --- libavfilter/ebur128.c | 54 +++------------------------------ libavfilter/ebur128.h | 69 +------------------------------------------ 2 files changed, 5 insertions(+), 118 deletions(-) diff --git a/libavfilter/ebur128.c b/libavfilter/ebur128.c index 2e86974eba..d93500ef3e 100644 --- a/libavfilter/ebur128.c +++ b/libavfilter/ebur128.c @@ -362,9 +362,6 @@ static void ebur128_filter_##type(FFEBUR128State* st, const type** srcs, st->d->v[ci][1] = fabs(st->d->v[ci][1]) < DBL_MIN ? 0.0 : st->d->v[ci][1]; \ } \ } -EBUR128_FILTER(short, -((double)SHRT_MIN)) -EBUR128_FILTER(int, -((double)INT_MIN)) -EBUR128_FILTER(float, 1.0) EBUR128_FILTER(double, 1.0) static double ebur128_energy_to_loudness(double energy) @@ -459,8 +456,8 @@ int ff_ebur128_set_channel(FFEBUR128State * st, } static int ebur128_energy_shortterm(FFEBUR128State * st, double *out); -#define FF_EBUR128_ADD_FRAMES_PLANAR(type) \ -void ff_ebur128_add_frames_planar_##type(FFEBUR128State* st, const type** srcs, \ +#define EBUR128_ADD_FRAMES_PLANAR(type) \ +static void ebur128_add_frames_planar_##type(FFEBUR128State* st, const type** srcs, \ size_t frames, int stride) { \ size_t src_index = 0; \ while (frames > 0) { \ @@ -502,10 +499,7 @@ void ff_ebur128_add_frames_planar_##type(FFEBUR128State* st, const type** srcs, } \ } \ } -FF_EBUR128_ADD_FRAMES_PLANAR(short) -FF_EBUR128_ADD_FRAMES_PLANAR(int) -FF_EBUR128_ADD_FRAMES_PLANAR(float) -FF_EBUR128_ADD_FRAMES_PLANAR(double) +EBUR128_ADD_FRAMES_PLANAR(double) #define FF_EBUR128_ADD_FRAMES(type) \ void ff_ebur128_add_frames_##type(FFEBUR128State* st, const type* src, \ size_t frames) { \ @@ -513,11 +507,8 @@ void ff_ebur128_add_frames_##type(FFEBUR128State* st, const type* src, \ const type **buf = (const type**)st->d->data_ptrs; \ for (i = 0; i < st->channels; i++) \ buf[i] = src + i; \ - ff_ebur128_add_frames_planar_##type(st, buf, frames, st->channels); \ + ebur128_add_frames_planar_##type(st, buf, frames, st->channels); \ } -FF_EBUR128_ADD_FRAMES(short) -FF_EBUR128_ADD_FRAMES(int) -FF_EBUR128_ADD_FRAMES(float) FF_EBUR128_ADD_FRAMES(double) static int ebur128_calc_relative_threshold(FFEBUR128State **sts, size_t size, @@ -606,12 +597,6 @@ int ff_ebur128_loudness_global(FFEBUR128State * st, double *out) return ebur128_gated_loudness(&st, 1, out); } -int ff_ebur128_loudness_global_multiple(FFEBUR128State ** sts, size_t size, - double *out) -{ - return ebur128_gated_loudness(sts, size, out); -} - static int ebur128_energy_in_interval(FFEBUR128State * st, size_t interval_frames, double *out) { @@ -628,21 +613,6 @@ static int ebur128_energy_shortterm(FFEBUR128State * st, double *out) out); } -int ff_ebur128_loudness_momentary(FFEBUR128State * st, double *out) -{ - double energy; - int error = ebur128_energy_in_interval(st, st->d->samples_in_100ms * 4, - &energy); - if (error) { - return error; - } else if (energy <= 0.0) { - *out = -HUGE_VAL; - return 0; - } - *out = ebur128_energy_to_loudness(energy); - return 0; -} - int ff_ebur128_loudness_shortterm(FFEBUR128State * st, double *out) { double energy; @@ -657,22 +627,6 @@ int ff_ebur128_loudness_shortterm(FFEBUR128State * st, double *out) return 0; } -int ff_ebur128_loudness_window(FFEBUR128State * st, - unsigned long window, double *out) -{ - double energy; - size_t interval_frames = st->samplerate * window / 1000; - int error = ebur128_energy_in_interval(st, interval_frames, &energy); - if (error) { - return error; - } else if (energy <= 0.0) { - *out = -HUGE_VAL; - return 0; - } - *out = ebur128_energy_to_loudness(energy); - return 0; -} - /* EBU - TECH 3342 */ int ff_ebur128_loudness_range_multiple(FFEBUR128State ** sts, size_t size, double *out) diff --git a/libavfilter/ebur128.h b/libavfilter/ebur128.h index 74367545e8..8e7385e044 100644 --- a/libavfilter/ebur128.h +++ b/libavfilter/ebur128.h @@ -81,7 +81,7 @@ enum channel { * modes that suit your needs, as performance will be better. */ enum mode { - /** can call ff_ebur128_loudness_momentary */ + /** can resurrrect and call ff_ebur128_loudness_momentary */ FF_EBUR128_MODE_M = (1 << 0), /** can call ff_ebur128_loudness_shortterm */ FF_EBUR128_MODE_S = (1 << 1) | FF_EBUR128_MODE_M, @@ -151,41 +151,9 @@ int ff_ebur128_set_channel(FFEBUR128State * st, * @param src array of source frames. Channels must be interleaved. * @param frames number of frames. Not number of samples! */ -void ff_ebur128_add_frames_short(FFEBUR128State * st, - const short *src, size_t frames); -/** \brief See \ref ebur128_add_frames_short */ -void ff_ebur128_add_frames_int(FFEBUR128State * st, - const int *src, size_t frames); -/** \brief See \ref ebur128_add_frames_short */ -void ff_ebur128_add_frames_float(FFEBUR128State * st, - const float *src, size_t frames); -/** \brief See \ref ebur128_add_frames_short */ void ff_ebur128_add_frames_double(FFEBUR128State * st, const double *src, size_t frames); -/** \brief Add frames to be processed. - * - * @param st library state. - * @param srcs array of source frame channel data pointers - * @param frames number of frames. Not number of samples! - * @param stride number of samples to skip to for the next sample of the same channel - */ -void ff_ebur128_add_frames_planar_short(FFEBUR128State * st, - const short **srcs, - size_t frames, int stride); -/** \brief See \ref ebur128_add_frames_planar_short */ -void ff_ebur128_add_frames_planar_int(FFEBUR128State * st, - const int **srcs, - size_t frames, int stride); -/** \brief See \ref ebur128_add_frames_planar_short */ -void ff_ebur128_add_frames_planar_float(FFEBUR128State * st, - const float **srcs, - size_t frames, int stride); -/** \brief See \ref ebur128_add_frames_planar_short */ -void ff_ebur128_add_frames_planar_double(FFEBUR128State * st, - const double **srcs, - size_t frames, int stride); - /** \brief Get global integrated loudness in LUFS. * * @param st library state. @@ -196,28 +164,7 @@ void ff_ebur128_add_frames_planar_double(FFEBUR128State * st, * - AVERROR(EINVAL) if mode "FF_EBUR128_MODE_I" has not been set. */ int ff_ebur128_loudness_global(FFEBUR128State * st, double *out); -/** \brief Get global integrated loudness in LUFS across multiple instances. - * - * @param sts array of library states. - * @param size length of sts - * @param out integrated loudness in LUFS. -HUGE_VAL if result is negative - * infinity. - * @return - * - 0 on success. - * - AVERROR(EINVAL) if mode "FF_EBUR128_MODE_I" has not been set. - */ -int ff_ebur128_loudness_global_multiple(FFEBUR128State ** sts, - size_t size, double *out); -/** \brief Get momentary loudness (last 400ms) in LUFS. - * - * @param st library state. - * @param out momentary loudness in LUFS. -HUGE_VAL if result is negative - * infinity. - * @return - * - 0 on success. - */ -int ff_ebur128_loudness_momentary(FFEBUR128State * st, double *out); /** \brief Get short-term loudness (last 3s) in LUFS. * * @param st library state. @@ -229,20 +176,6 @@ int ff_ebur128_loudness_momentary(FFEBUR128State * st, double *out); */ int ff_ebur128_loudness_shortterm(FFEBUR128State * st, double *out); -/** \brief Get loudness of the specified window in LUFS. - * - * window must not be larger than the current window set in st. - * - * @param st library state. - * @param window window in ms to calculate loudness. - * @param out loudness in LUFS. -HUGE_VAL if result is negative infinity. - * @return - * - 0 on success. - * - AVERROR(EINVAL) if window larger than current window in st. - */ -int ff_ebur128_loudness_window(FFEBUR128State * st, - unsigned long window, double *out); - /** \brief Get loudness range (LRA) of programme in LU. * * Calculates loudness range according to EBU 3342. From patchwork Fri Jan 29 05:22:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 25257 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 989F744B195 for ; Fri, 29 Jan 2021 07:55:21 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6C344689AB4; Fri, 29 Jan 2021 07:55:21 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A42A1680C9A for ; Fri, 29 Jan 2021 07:55:14 +0200 (EET) Received: by mail-wr1-f47.google.com with SMTP id g10so7648051wrx.1 for ; Thu, 28 Jan 2021 21:55:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4KN7Ai6DX9twZX5d8bYHcgylXq7Q03c82YMlDgoznsc=; b=UmuPv7JVuvAkHuK6c5ngbj1A0M1bSiu+3l5WrTTrvrJHrcX3pYz/vmPUaUBZrViod5 2roz3LYpIhJmEC7dp2aLEkbISKJ9v3Cu+Isy58RYeqdnBnplsRo7DhmJzpuaxZeGpZ6D A1LEznVyaY9mUsd7IffsBtMY8yaxgvQQuHDmXHR5S+hAN/0yCTa3fA47V+neJEV8X1kp q1G0v8NGw2Bwpyb9jpY7OundrhvF4zGE+T9I2TZKRClo7cHqN2DIjJaG+1m2LXEtOn+P dh1V5puKwYwzT1tp7dPj4w90z+31/uC79XGYBiFPHUZSR5EIQc0XrAJia2CDWrZRs3Hf nBnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4KN7Ai6DX9twZX5d8bYHcgylXq7Q03c82YMlDgoznsc=; b=YQmmqYFVIBjo04nWEgXX6K4tgTD0RUBSRk5OMDKERUXk03tCeTy73eDB1ZZQCIk7hg Xaw8RjLJ40csZ1hLDJG6kmM1mHvafiLGiwCesSTDsbn8+EruYosi4vOwxTZkwWdXAlDW XRr/r+OR/AMug2WtJfvtDuzII0jd1hWm8RRN2QeduL7IyxpPCGE36U4xoRnE9/QqevX1 drXwKkbq8iOhNeV9ampry11Lo78pvFOSWLdEIrGBXGLm9LjR61EZqxSBYOmOeLFCthlr 4hxRY0yynvyfzMAtEgNZPHbhdmV9BbaizooSFhuDFv0j2iCgjjQnKyTFC51sFvEqKHMc Cimw== X-Gm-Message-State: AOAM530Lziayl8gOlRqXO922/ceZxVs4dKgRRWohjIL5qEkQtH/uSAUz aHlR+kvN6JsAFyRPp2nOSOPYOBDz9Ns= X-Google-Smtp-Source: ABdhPJzAyNB0+uAj7QCWU2aSWRyS5FeMM1K80LKNpoe31zT+BBAd+U82x5Foxz8aa430U5nvdpEVZA== X-Received: by 2002:a5d:47a2:: with SMTP id 2mr2424732wrb.393.1611897983420; Thu, 28 Jan 2021 21:26:23 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id d13sm10068611wrx.93.2021.01.28.21.26.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 21:26:22 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 29 Jan 2021 06:22:59 +0100 Message-Id: <20210129052302.3124447-10-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> References: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 10/13] avcodec/h264_levels, h265_profile_level: Remove ff_h26[45]_get_level X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" Unused. Signed-off-by: Andreas Rheinhardt --- libavcodec/h264_levels.c | 12 ------------ libavcodec/h264_levels.h | 3 --- libavcodec/h265_profile_level.c | 12 ------------ libavcodec/h265_profile_level.h | 2 -- 4 files changed, 29 deletions(-) diff --git a/libavcodec/h264_levels.c b/libavcodec/h264_levels.c index dd517f1005..801b27fdd9 100644 --- a/libavcodec/h264_levels.c +++ b/libavcodec/h264_levels.c @@ -75,18 +75,6 @@ static int h264_get_br_factor(int profile_idc) return 1200; } -const H264LevelDescriptor *ff_h264_get_level(int level_idc, - int constraint_set3_flag) -{ - int i; - for (i = 0; i < FF_ARRAY_ELEMS(h264_levels); i++) { - if (h264_levels[i].level_idc == level_idc && - h264_levels[i].constraint_set3_flag == constraint_set3_flag) - return &h264_levels[i]; - } - return NULL; -} - const H264LevelDescriptor *ff_h264_guess_level(int profile_idc, int64_t bitrate, int framerate, diff --git a/libavcodec/h264_levels.h b/libavcodec/h264_levels.h index 0a0f410329..6bba2e8624 100644 --- a/libavcodec/h264_levels.h +++ b/libavcodec/h264_levels.h @@ -36,9 +36,6 @@ typedef struct H264LevelDescriptor { uint8_t max_mvs_per_2mb; } H264LevelDescriptor; -const H264LevelDescriptor *ff_h264_get_level(int level_idc, - int constraint_set3_flag); - /** * Guess the level of a stream from some parameters. * diff --git a/libavcodec/h265_profile_level.c b/libavcodec/h265_profile_level.c index d79c1ab204..7ff9681f65 100644 --- a/libavcodec/h265_profile_level.c +++ b/libavcodec/h265_profile_level.c @@ -120,18 +120,6 @@ static const H265ProfileDescriptor h265_profiles[] = { }; -const H265LevelDescriptor *ff_h265_get_level(int level_idc) -{ - int i; - - for (i = 0; i < FF_ARRAY_ELEMS(h265_levels); i++) { - if (h265_levels[i].level_idc == level_idc) - return &h265_levels[i]; - } - - return NULL; -} - const H265ProfileDescriptor *ff_h265_get_profile(const H265RawProfileTierLevel *ptl) { int i; diff --git a/libavcodec/h265_profile_level.h b/libavcodec/h265_profile_level.h index 2d5bebaecd..f1a11f51dc 100644 --- a/libavcodec/h265_profile_level.h +++ b/libavcodec/h265_profile_level.h @@ -70,8 +70,6 @@ typedef struct H265ProfileDescriptor { } H265ProfileDescriptor; -const H265LevelDescriptor *ff_h265_get_level(int level_idc); - const H265ProfileDescriptor *ff_h265_get_profile(const H265RawProfileTierLevel *ptl); From patchwork Fri Jan 29 05:23:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 25253 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id F0BEF44B9EE for ; Fri, 29 Jan 2021 07:34:11 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DBE3268A800; Fri, 29 Jan 2021 07:34:11 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 049B068A76A for ; Fri, 29 Jan 2021 07:34:06 +0200 (EET) Received: by mail-wr1-f53.google.com with SMTP id p15so7585281wrq.8 for ; Thu, 28 Jan 2021 21:34:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RCRPso8e+bJlkvV83Xx6R+RyLt9tsh80eRO6e9b8FuE=; b=jAAxP5CfMKSuaFwNrVHhtLDYzz8BjaaI3Ne4mVhktXmJYoKyMkfoJZDsq4XMvj1Rn1 uZV047MNbVWQElaUyp+CXj8iXjoT+WIxjr5+8o/FSoQrAwjxviCgzfFvwGNhjfXhefIQ d6lVoG66lvdby3wkfQvZXlfzydPyGTLsQkiWrr8XvkUS0NrHLPfV0/xGJ/fKBDxjMsex /vl7T/oTeSNgtWGLt3/oc77nvmQT8IBxKAlPLfC25651ZHAIzLlgRQ80PTWXvnMrWFJr vl0J7qPxx3uJxOmc/zPsRDN3yyx3dr1JXkFQ2iIAf0XP2MrDz6z0mvq9PV3RVnA6CEoE KZ1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RCRPso8e+bJlkvV83Xx6R+RyLt9tsh80eRO6e9b8FuE=; b=VNLVndT2x6HpHUyVbOfk3h1Fhs5EhIwir5E5uLhrG0yeBSRwiLI76JKk9zyUS4YfU/ 0ZOJ5QHW8JcyXpQdZ8lGFLKNJtCO0t2vJwpIBWS8dcYxHSJMXlnWC/ZFzKmtEvP+JfeY rn20mrORDIyCafY2l8uAlyeASADQMx57Mhm/3SZrPdxoqqAhsrzcUbB+j6wP0+ET+dMR QlsgZNFjcUOWUMGENUwYz/C1iJ88nBd29b8kcghZjl8FpmPiuBxK4aoDZRYbeM9zwdi9 EXKPr9farTP6VK/XACX95WtaayiWzoemPOXkWRWrnAoOpxQRIopKnneAlnhlUDZE8bLr S5tQ== X-Gm-Message-State: AOAM530RGHe+sXr5RGHpiul8zzKQPGI7GG15jJLRenTgstnQVBkCkWPd Hoak2t58k+VxrfrQ9Fa5hQtjLWdG/mg= X-Google-Smtp-Source: ABdhPJwY2NrOX1uSuzXhf/r8FvUzN+GgNP0RW0vd9qi0JlfprI9iVzJ/Dql8rsuufm6PtxYvW9hjVg== X-Received: by 2002:adf:f1c3:: with SMTP id z3mr2509531wro.96.1611897984580; Thu, 28 Jan 2021 21:26:24 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id d13sm10068611wrx.93.2021.01.28.21.26.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 21:26:24 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 29 Jan 2021 06:23:00 +0100 Message-Id: <20210129052302.3124447-11-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> References: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 11/13] avcodec/cabac: Move encoder related stuff to libavcodec/tests/cabac.c X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" (This is actually the second time the encoder stuff is removed; the first was in 8b4119187b62d6932e07aded11d33d3b24e1b42f.) Signed-off-by: Andreas Rheinhardt --- libavcodec/cabac.c | 12 ------ libavcodec/cabac.h | 5 --- libavcodec/tests/cabac.c | 93 +++++++++++++++++++++++++--------------- 3 files changed, 59 insertions(+), 51 deletions(-) diff --git a/libavcodec/cabac.c b/libavcodec/cabac.c index 3bbecf50dd..6649feebeb 100644 --- a/libavcodec/cabac.c +++ b/libavcodec/cabac.c @@ -158,18 +158,6 @@ DECLARE_ASM_ALIGNED(1, const uint8_t, ff_h264_cabac_tables)[512 + 4*2*64 + 4*64 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8 }; -/** - * @param buf_size size of buf in bits - */ -void ff_init_cabac_encoder(CABACContext *c, uint8_t *buf, int buf_size){ - init_put_bits(&c->pb, buf, buf_size); - - c->low= 0; - c->range= 0x1FE; - c->outstanding_count= 0; - c->pb.bit_left++; //avoids firstBitFlag -} - /** * * @param buf_size size of buf in bits diff --git a/libavcodec/cabac.h b/libavcodec/cabac.h index 1bf1c620d6..38d06b2842 100644 --- a/libavcodec/cabac.h +++ b/libavcodec/cabac.h @@ -29,8 +29,6 @@ #include -#include "put_bits.h" - extern const uint8_t ff_h264_cabac_tables[512 + 4*2*64 + 4*64 + 63]; #define H264_NORM_SHIFT_OFFSET 0 #define H264_LPS_RANGE_OFFSET 512 @@ -43,14 +41,11 @@ extern const uint8_t ff_h264_cabac_tables[512 + 4*2*64 + 4*64 + 63]; typedef struct CABACContext{ int low; int range; - int outstanding_count; const uint8_t *bytestream_start; const uint8_t *bytestream; const uint8_t *bytestream_end; - PutBitContext pb; }CABACContext; -void ff_init_cabac_encoder(CABACContext *c, uint8_t *buf, int buf_size); int ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size); #endif /* AVCODEC_CABAC_H */ diff --git a/libavcodec/tests/cabac.c b/libavcodec/tests/cabac.c index affe4eb141..a8bd131c95 100644 --- a/libavcodec/tests/cabac.c +++ b/libavcodec/tests/cabac.c @@ -24,41 +24,51 @@ #include "libavutil/lfg.h" #include "libavcodec/avcodec.h" +#include "libavcodec/put_bits.h" -static inline void put_cabac_bit(CABACContext *c, int b){ +typedef struct CABACTestContext { + CABACContext dec; + int outstanding_count; + PutBitContext pb; +} CABACTestContext; + +static inline void put_cabac_bit(CABACTestContext *c, int b) +{ put_bits(&c->pb, 1, b); for(;c->outstanding_count; c->outstanding_count--){ put_bits(&c->pb, 1, 1-b); } } -static inline void renorm_cabac_encoder(CABACContext *c){ - while(c->range < 0x100){ +static inline void renorm_cabac_encoder(CABACTestContext *c) +{ + while (c->dec.range < 0x100) { //FIXME optimize - if(c->low<0x100){ + if (c->dec.low < 0x100) { put_cabac_bit(c, 0); - }else if(c->low<0x200){ + } else if (c->dec.low < 0x200) { c->outstanding_count++; - c->low -= 0x100; + c->dec.low -= 0x100; }else{ put_cabac_bit(c, 1); - c->low -= 0x200; + c->dec.low -= 0x200; } - c->range+= c->range; - c->low += c->low; + c->dec.range += c->dec.range; + c->dec.low += c->dec.low; } } -static void put_cabac(CABACContext *c, uint8_t * const state, int bit){ - int RangeLPS= ff_h264_lps_range[2*(c->range&0xC0) + *state]; +static void put_cabac(CABACTestContext *c, uint8_t * const state, int bit) +{ + int RangeLPS = ff_h264_lps_range[2 * (c->dec.range & 0xC0) + *state]; if(bit == ((*state)&1)){ - c->range -= RangeLPS; + c->dec.range -= RangeLPS; *state = ff_h264_mlps_state[128 + *state]; }else{ - c->low += c->range - RangeLPS; - c->range = RangeLPS; + c->dec.low += c->dec.range - RangeLPS; + c->dec.range = RangeLPS; *state= ff_h264_mlps_state[127 - *state]; } @@ -68,21 +78,22 @@ static void put_cabac(CABACContext *c, uint8_t * const state, int bit){ /** * @param bit 0 -> write zero bit, !=0 write one bit */ -static void put_cabac_bypass(CABACContext *c, int bit){ - c->low += c->low; +static void put_cabac_bypass(CABACTestContext *c, int bit) +{ + c->dec.low += c->dec.low; if(bit){ - c->low += c->range; + c->dec.low += c->dec.range; } //FIXME optimize - if(c->low<0x200){ + if (c->dec.low < 0x200) { put_cabac_bit(c, 0); - }else if(c->low<0x400){ + } else if (c->dec.low < 0x400) { c->outstanding_count++; - c->low -= 0x200; + c->dec.low -= 0x200; }else{ put_cabac_bit(c, 1); - c->low -= 0x400; + c->dec.low -= 0x400; } } @@ -90,20 +101,21 @@ static void put_cabac_bypass(CABACContext *c, int bit){ * * @return the number of bytes written */ -static int put_cabac_terminate(CABACContext *c, int bit){ - c->range -= 2; +static int put_cabac_terminate(CABACTestContext *c, int bit) +{ + c->dec.range -= 2; if(!bit){ renorm_cabac_encoder(c); }else{ - c->low += c->range; - c->range= 2; + c->dec.low += c->dec.range; + c->dec.range = 2; renorm_cabac_encoder(c); - av_assert0(c->low <= 0x1FF); - put_cabac_bit(c, c->low>>9); - put_bits(&c->pb, 2, ((c->low>>7)&3)|1); + av_assert0(c->dec.low <= 0x1FF); + put_cabac_bit(c, c->dec.low >> 9); + put_bits(&c->pb, 2, ((c->dec.low >> 7) & 3) | 1); flush_put_bits(&c->pb); //FIXME FIXME FIXME XXX wrong } @@ -111,8 +123,21 @@ static int put_cabac_terminate(CABACContext *c, int bit){ return (put_bits_count(&c->pb)+7)>>3; } +/** + * @param buf_size size of buf in bits + */ +static void init_cabac_encoder(CABACTestContext *c, uint8_t *buf, int buf_size) +{ + init_put_bits(&c->pb, buf, buf_size); + + c->dec.low = 0; + c->dec.range = 0x1FE; + c->outstanding_count = 0; + c->pb.bit_left++; //avoids firstBitFlag +} + int main(void){ - CABACContext c; + CABACTestContext c; uint8_t b[9*SIZE]; uint8_t r[9*SIZE]; int i, ret = 0; @@ -120,7 +145,7 @@ int main(void){ AVLFG prng; av_lfg_init(&prng, 1); - ff_init_cabac_encoder(&c, b, SIZE); + init_cabac_encoder(&c, b, SIZE); for(i=0; i X-Patchwork-Id: 25246 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id CD32544B7ED for ; Fri, 29 Jan 2021 07:31:44 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A209B689CFB; Fri, 29 Jan 2021 07:31:44 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BBD52687FCE for ; Fri, 29 Jan 2021 07:31:38 +0200 (EET) Received: by mail-wr1-f51.google.com with SMTP id g10so7615434wrx.1 for ; Thu, 28 Jan 2021 21:31:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3MPCVJZysQ0JAqUEhcjgMMr0ngxALI+tlxOHZR/eyqw=; b=RSWbKmgH9JZiyoDR7/G/M0+29QJhLdVno7rHyEWqA+1MMDKm+zUUh+3txRPBgqvuO8 Q3/394BndalrNmJevDiwaiBTQsV2UrN8mvktXOtCFCXDr9z/pZ7j7ibIKRIiVPpWrI6U ziDRJf5ZHk7vAkDCShFs6Ai159eYi9huRDiPHbFLOh8iYGAYKxFCWHr07B3b3o4j24L+ 2un71/SaZNfXENf9ZUl7NARlN3MFA77ur4A7HcYsMzhQobq9efPGJZKrQ8SHH8BwmRFM gsD5Obgcg5j/6Im7EKR63bDHV62k6TIVmzgJyCLRbB44odbY1jWKq5Cw0icriZ3y2Hxr 9RgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3MPCVJZysQ0JAqUEhcjgMMr0ngxALI+tlxOHZR/eyqw=; b=OClhMkr1ti6cm3YkP5sWR9zijzV8IPQf7ZFLf6wYiB5OpgPk0Tf9/9nlp/ajeKwHPT xoQP8ab5gKUBRtb7RCPCUJ2DfulgaULiHgbZdLk+3WreRgCfs76rAEc6jTT9FfhtDXpO JHuksAXNdRE6E4f5HfFbWLyjky/fSyHLpFx5yIUkdw8+q7SKQRErLMSgdbWwZb75LP+b uGIozuegkf9hMXxSn0czg0Eo+S+Wu3BmhFRw25dUxnC1PleQOGp6LDRpbjlmuKg6ddPn 0BM+n8yEmb8EYthzFGtpx7kC/pWhl7wRf7erMzTdPOTo/pJ1oZpDjEiDKHZZNjSCA7kx F4Fg== X-Gm-Message-State: AOAM530R9f0xSvsz+jNwgtk+A3VUchLFZnAiBvd40N7tCH39aqTQYArT hq8L2HmqumOhltOEUVuYWqIcfsEALIM= X-Google-Smtp-Source: ABdhPJwWE9pQFdbJU6j4aeHr/GcIxx2Q59JubOdU/v1T/cqrXGrnkRrmfOHp8GAuHBBXcfBav7/XFw== X-Received: by 2002:a5d:5049:: with SMTP id h9mr2572256wrt.404.1611897985438; Thu, 28 Jan 2021 21:26:25 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id d13sm10068611wrx.93.2021.01.28.21.26.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 21:26:24 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 29 Jan 2021 06:23:01 +0100 Message-Id: <20210129052302.3124447-12-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> References: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 12/13] fftools/ffmpeg_filter: Remove ist_in_filtergraph X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" Unused since af1761f7b5b1b72197dc40934953b775c2d951cc. Signed-off-by: Andreas Rheinhardt --- fftools/ffmpeg.h | 1 - fftools/ffmpeg_filter.c | 9 --------- 2 files changed, 10 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 6750432a81..fa726575f4 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -656,7 +656,6 @@ enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *avctx, int configure_filtergraph(FilterGraph *fg); int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out); void check_filter_outputs(void); -int ist_in_filtergraph(FilterGraph *fg, InputStream *ist); int filtergraph_is_simple(FilterGraph *fg); int init_simple_filtergraph(InputStream *ist, OutputStream *ost); int init_complex_filtergraph(FilterGraph *fg); diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 38e44d560b..aff0ebe6ab 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -1183,15 +1183,6 @@ int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *frame) return 0; } -int ist_in_filtergraph(FilterGraph *fg, InputStream *ist) -{ - int i; - for (i = 0; i < fg->nb_inputs; i++) - if (fg->inputs[i]->ist == ist) - return 1; - return 0; -} - int filtergraph_is_simple(FilterGraph *fg) { return !fg->graph_desc; From patchwork Fri Jan 29 05:23:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 25248 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 2777644B9D9 for ; Fri, 29 Jan 2021 07:33:14 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0E67068A767; Fri, 29 Jan 2021 07:33:14 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 828A86899DD for ; Fri, 29 Jan 2021 07:33:08 +0200 (EET) Received: by mail-wm1-f48.google.com with SMTP id u14so6207525wmq.4 for ; Thu, 28 Jan 2021 21:33:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IXCTHsc/tFTXWK5e8nq1Oe+g6LWn18ugeMrSJb7EJxY=; b=GpD+yDannPYSeUi51lIzar4s/YeD9dFZm10v0xYkRq2cMAZ7QwkVTaQHMlm34DEy60 dBt9eR5RztMkP9PwFlNSEdwQLj6qjnCLK4l+KObeha0rzNa1HaOYjMMYVcspNTzUhfqr V8ktdOFTj218hC2P879c4YyF5lhF8hg7lpXAQFNCQhp/41fPrmS6PtHAQhKIHvKNaqPk AwftkV42fPcTnTCTslsBnEvfRuy3zP8kH/OpheLwuhLkxuzJkGqRb1RXfN6fX8fQDj8/ XVQOWuqPpWeY/avOn9U6zzmzK/0SCf4l5xpRDEQpltf1rRlP0mp5C+cnhrMmzBJ7+k5C krnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IXCTHsc/tFTXWK5e8nq1Oe+g6LWn18ugeMrSJb7EJxY=; b=Dg5EorCVROZHp4QbnsD1wvJUXv3zGuPHzPdfrQ0wrsLT9Z+fchPa/HUFDFrgJrmfnr hySwRzP2RvO737TfRrGXYDrKOvIPO39gRjwKXWW8srDh8Jw3UR2PkOprMbjcbHKu/NvP PKCObsxBEPv2HxMS+U6C44MwjchbeN0kzzgMdN7tktU39DwxdV30dk1YLszlw8oqZJ1Z PccecHajLPWcdQRVQbuREG9oEjo33weo86sse2elcvqPWlj4O64WuHRNbyjZbIcDCJ1L AswpkZd/O8lHIxP147xjKLVJASyzvO6SEV5le5252XuJnL7k7HbmpJ6EKB/6xIi4OIpK Ytqw== X-Gm-Message-State: AOAM530sBeRvjoKie5vO8j+1XVpRmyw1LqxUxIOvCRau0d22OOboG5Z/ nKRKWLAtQFA7i8MHa01U6RVR5ziXGLk= X-Google-Smtp-Source: ABdhPJz4MgYZnUZ6ezRIiNhDgL2HWQ3UG2XoyVPzggW96sc/Ntl7P5BTMfcPM7U9G3KwJT9bcw9Auw== X-Received: by 2002:a05:600c:20c:: with SMTP id 12mr2077112wmi.125.1611897986487; Thu, 28 Jan 2021 21:26:26 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id d13sm10068611wrx.93.2021.01.28.21.26.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 21:26:25 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 29 Jan 2021 06:23:02 +0100 Message-Id: <20210129052302.3124447-13-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> References: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 13/13] fftools/ffmpeg_filter: Make functions only used locally static X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" Also remove some declarations of inexistent functions while at it. Signed-off-by: Andreas Rheinhardt --- fftools/ffmpeg.h | 7 ------- fftools/ffmpeg_filter.c | 5 +++-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index fa726575f4..5aeceae6b7 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -640,21 +640,14 @@ extern HWDevice *filter_hw_device; void term_init(void); void term_exit(void); -void reset_options(OptionsContext *o, int is_input); void show_usage(void); -void opt_output_file(void *optctx, const char *filename); - void remove_avoptions(AVDictionary **a, AVDictionary *b); void assert_avoptions(AVDictionary *m); int guess_input_channel_layout(InputStream *ist); -enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *avctx, - const AVCodec *codec, enum AVPixelFormat target); - int configure_filtergraph(FilterGraph *fg); -int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out); void check_filter_outputs(void); int filtergraph_is_simple(FilterGraph *fg); int init_simple_filtergraph(InputStream *ist, OutputStream *ost); diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index aff0ebe6ab..22a33e4697 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -60,7 +60,7 @@ static const enum AVPixelFormat *get_compliance_unofficial_pix_fmts(enum AVCodec } } -enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *enc_ctx, +static enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *enc_ctx, const AVCodec *codec, enum AVPixelFormat target) { if (codec && codec->pix_fmts) { @@ -652,7 +652,8 @@ static int configure_output_audio_filter(FilterGraph *fg, OutputFilter *ofilter, return 0; } -int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out) +static int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, + AVFilterInOut *out) { if (!ofilter->ost) { av_log(NULL, AV_LOG_FATAL, "Filter %s has an unconnected output\n", ofilter->name);