From patchwork Tue Sep 26 22:17:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 43953 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:2a18:b0:15d:8365:d4b8 with SMTP id e24csp2210807pzh; Tue, 26 Sep 2023 15:22:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGueuuG1DG5yjQIAlaXTCBQIeTk0KncIhdjkyS9dEua9KEveSXXInnAcT/ae5IQA+aU21Yp X-Received: by 2002:a17:907:2cf8:b0:9a2:1e14:86b9 with SMTP id hz24-20020a1709072cf800b009a21e1486b9mr411315ejc.0.1695766942559; Tue, 26 Sep 2023 15:22:22 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id z22-20020a170906815600b0098cda9c19f0si11093807ejw.762.2023.09.26.15.22.22; Tue, 26 Sep 2023 15:22:22 -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=@outlook.com header.s=selector1 header.b=eJsyovz1; arc=fail (body hash mismatch); 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=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 52C5168CAB1; Wed, 27 Sep 2023 01:20:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01olkn2098.outbound.protection.outlook.com [40.92.64.98]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C144368CAB1 for ; Wed, 27 Sep 2023 01:20:23 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OzvtwN/a1KWxyn4uksV+am5qDZaz7BPa4aV+36KY8njgsyQYPYusU8ya3laCcuXztL+VoKg/ZjoWfNuNhNKtth++pvt/y4pzn72uKoT0k2bMvaYqej5dt0yKqhTQgxH/wEjcxyhcjuvMooc2MW1j/1d4qyOemHt61Lhblz9/3LSFr4nmF0u+ryw4ZeQ5txowF4Li5eflYDVmaLVH2f+mYavpszbibKV7qXhHB1k8nTRtcdwNHuaUkNxTUDDhta6/T3DxFrsXIwMfY4S1noHJEKGnj68eqzC1gWtBO0rmKvdqjvp1ctnDo/80H6L6CyfUR3WUOrOFBfLxReaGiA6/hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gm9UDZDONbBRjUBIUDBrml7fWwjQbze0mWeyKV3ovFc=; b=TdioruhHAeLtNFT0Sx/5auZ9bZVHITHsFQan5ITcT27YHSf3edke4pN2k2SloEn4wHGARqGaK+Jc3HqTz7epWbXkgJRzeLe1l6vBmh9rAZ/H9xpLHTWYK5BxebcSuWcqiSEx8arxhUCPjsrNjocvwcaJeWh2laa1s1fZ2b/1a4etc7KOwlTFwMoB+L4370Wn5neosShgYTT7FBAuF8Gt2Bf1hIvLjHocEcKunQCq7/cXuDF8t7tj8HIdr3W1zAm4kETftQuJGMQcBi0dPHLa3DBO/D3MzYVcV25BHZdnBucvZLnh9/NCLIEQX6m24vLzun55aR6VDUObPktKvTewIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gm9UDZDONbBRjUBIUDBrml7fWwjQbze0mWeyKV3ovFc=; b=eJsyovz1w/xF+nov8vyG+/Y/DqeLHbyAod59//RlaEgrTQkEcRGVNNWl2GFTPbEWMoCzJkdZu+18Ajw+lHDlBOZLwD8ENYjhV/9IOO3i8L+w5OSB0mAAacbsvo4Md1JV+iZ0eA+iFrQpIAcaRPGUMEB8MovstYsGYw4g/001Cx+XV8wE9smsozwLALIG7U+7/k27sphf6VjBY9aLvSujeXrkZjdeYbMccIT2tEIBmTfXRFdQLOsGGN3+i426mnDAPCh82spg39F/0PvWPx+UNldmeBQd6ZY2t5sPUmEc2NnKMJ1FRWE4fvGPe+icyB5F+6kuPWhaZM4b3e8mtgHX0A== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS8P250MB0393.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:37e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Tue, 26 Sep 2023 22:20:22 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::9d42:7b4f:71ef:c76a]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::9d42:7b4f:71ef:c76a%3]) with mapi id 15.20.6813.027; Tue, 26 Sep 2023 22:20:22 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 27 Sep 2023 00:17:12 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [2oNv4sdPGvV3BefsF+nvDbAmCh9ZhP4N] X-ClientProxiedBy: FR3P281CA0019.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::6) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20230926221732.3711507-40-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS8P250MB0393:EE_ X-MS-Office365-Filtering-Correlation-Id: b5c8a30b-5d60-43b5-b11b-08dbbedec64b X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7i5HCyuSTKk4JO5cOqxcpqis+MWtAKrmumqK8FQwiy16Y632jUj15fnZxagtIXgl3VgsFJRifShBcD//i3CAi6UnZ7JFVKKwQ5I4FnOyjBNdf4zDI5XxLOMQt0NH/ybGLzAcNlrOOWD/+hE2CIwsmyth0AUwLK5T2e/BKcRf6b9D9opCH7wv8eijNXIcbgb/EiJfvbyA51EMKX0LV8R75tLCCnhfyTt7GOyh28yp2wS1M3IudAzwXPUUe3cI0x9X7f0zQpVlNfRvwdNYZhS4Hjw7MQC3svsK576vuM1sb9EsxOMFV02r9dlKwvaALIcWQK6B54+YfpIRZIXK3l8hF7+9Y94BikR0zevYX9y/UDcU9tLnvUUSKRzOLtvHGRqxz1ZkqkC9d2scOyCwBiOgFfXKogQOXw/15CHNIG4WMcEN+eDuNEvhof5WFzEWp1BAplaLDP59uwUEC5nMjMJQ5MTt/TPwP6TgmlNG+Te1doofnpznqlHj9pUGvhkAEZhQ/U+bZIR0uMLXf8f6jYpr8e690SkhRYufwvBRZAnF1eT01Dz0oGd/TSiAsR/dBEpsw7wZ8bDSjelrCAYaIprXA15s5Kp7wKmMXaOKTF0Tkek= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5dM5PlkCFUzHprkwGg2/9wA9NzyRLAfDXnjY7ZUvaRRaWnKPHgujwSrsgIJIWm1mEyXQNXmYTK1JR3VKXH4xRToiAtxjfaiXi+zdAKFHf7Xd/5oaUQQeDzY4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2IZMdcC+75otE7O0zXaSU2USH6Wn1DqelNRyxL1+79or3lbxMnpw9c2SmqAz+evZZcFGvd X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b5c8a30b-5d60-43b5-b11b-08dbbedec64b X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2023 22:20:22.4193 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8P250MB0393 Subject: [FFmpeg-devel] [PATCH 41/61] avcodec/aacps: Pass logctx as void* instead of AVCodecContext* 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: neIBP+SgMugh Signed-off-by: Andreas Rheinhardt --- libavcodec/aacps.h | 3 +-- libavcodec/aacps_common.c | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/libavcodec/aacps.h b/libavcodec/aacps.h index 9d7e79c2b2..c8814b4c3d 100644 --- a/libavcodec/aacps.h +++ b/libavcodec/aacps.h @@ -27,7 +27,6 @@ #include "libavutil/mem_internal.h" #include "aacpsdsp.h" -#include "avcodec.h" #include "get_bits.h" #define PS_MAX_NUM_ENV 5 @@ -95,7 +94,7 @@ extern const int8_t ff_k_to_i_34[]; void ff_ps_init_common(void); void AAC_RENAME(ff_ps_init)(void); void AAC_RENAME(ff_ps_ctx_init)(PSContext *ps); -int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb, +int ff_ps_read_data(void *logctx, GetBitContext *gb, PSCommonContext *ps, int bits_left); int AAC_RENAME(ff_ps_apply)(PSContext *ps, INTFLOAT L[2][38][64], INTFLOAT R[2][38][64], int top); diff --git a/libavcodec/aacps_common.c b/libavcodec/aacps_common.c index bee07b5fb3..11bdb960cf 100644 --- a/libavcodec/aacps_common.c +++ b/libavcodec/aacps_common.c @@ -67,14 +67,14 @@ static VLC vlc_ps[10]; * Inter-channel Phase Difference/Overall Phase Difference parameters from the \ * bitstream. \ * \ - * @param avctx contains the current codec context \ + * @param logctx a context for logging \ * @param gb pointer to the input bitstream \ * @param ps pointer to the Parametric Stereo context \ * @param PAR pointer to the parameter to be read \ * @param e envelope to decode \ * @param dt 1: time delta-coded, 0: frequency delta-coded \ */ \ -static int read_ ## PAR ## _data(AVCodecContext *avctx, GetBitContext *gb, PSCommonContext *ps, \ +static int read_ ## PAR ## _data(void *logctx, GetBitContext *gb, PSCommonContext *ps, \ int8_t (*PAR)[PS_MAX_NR_IIDICC], int table_idx, int e, int dt) \ { \ int b, num = ps->nr_ ## PAR ## _par; \ @@ -101,7 +101,7 @@ static int read_ ## PAR ## _data(AVCodecContext *avctx, GetBitContext *gb, PSCom } \ return 0; \ err: \ - av_log(avctx, AV_LOG_ERROR, "illegal "#PAR"\n"); \ + av_log(logctx, AV_LOG_ERROR, "illegal "#PAR"\n"); \ return AVERROR_INVALIDDATA; \ } @@ -131,7 +131,7 @@ static int ps_read_extension_data(GetBitContext *gb, PSCommonContext *ps, return get_bits_count(gb) - count; } -int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host, +int ff_ps_read_data(void *logctx, GetBitContext *gb_host, PSCommonContext *ps, int bits_left) { int e; @@ -146,7 +146,7 @@ int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host, if (ps->enable_iid) { int iid_mode = get_bits(gb, 3); if (iid_mode > 5) { - av_log(avctx, AV_LOG_ERROR, "iid_mode %d is reserved.\n", + av_log(logctx, AV_LOG_ERROR, "iid_mode %d is reserved.\n", iid_mode); goto err; } @@ -158,7 +158,7 @@ int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host, if (ps->enable_icc) { ps->icc_mode = get_bits(gb, 3); if (ps->icc_mode > 5) { - av_log(avctx, AV_LOG_ERROR, "icc_mode %d is reserved.\n", + av_log(logctx, AV_LOG_ERROR, "icc_mode %d is reserved.\n", ps->icc_mode); goto err; } @@ -176,7 +176,7 @@ int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host, for (e = 1; e <= ps->num_env; e++) { ps->border_position[e] = get_bits(gb, 5); if (ps->border_position[e] < ps->border_position[e-1]) { - av_log(avctx, AV_LOG_ERROR, "border_position non monotone.\n"); + av_log(logctx, AV_LOG_ERROR, "border_position non monotone.\n"); goto err; } } @@ -187,7 +187,7 @@ int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host, if (ps->enable_iid) { for (e = 0; e < ps->num_env; e++) { int dt = get_bits1(gb); - if (read_iid_data(avctx, gb, ps, ps->iid_par, huff_iid[2*dt+ps->iid_quant], e, dt)) + if (read_iid_data(logctx, gb, ps, ps->iid_par, huff_iid[2*dt+ps->iid_quant], e, dt)) goto err; } } else @@ -196,7 +196,7 @@ int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host, if (ps->enable_icc) for (e = 0; e < ps->num_env; e++) { int dt = get_bits1(gb); - if (read_icc_data(avctx, gb, ps, ps->icc_par, dt ? huff_icc_dt : huff_icc_df, e, dt)) + if (read_icc_data(logctx, gb, ps, ps->icc_par, dt ? huff_icc_dt : huff_icc_df, e, dt)) goto err; } else @@ -213,7 +213,7 @@ int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host, cnt -= 2 + ps_read_extension_data(gb, ps, ps_extension_id); } if (cnt < 0) { - av_log(avctx, AV_LOG_ERROR, "ps extension overflow %d\n", cnt); + av_log(logctx, AV_LOG_ERROR, "ps extension overflow %d\n", cnt); goto err; } skip_bits(gb, cnt); @@ -241,7 +241,7 @@ int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host, if (ps->enable_iid){ for (b = 0; b < ps->nr_iid_par; b++) { if (FFABS(ps->iid_par[ps->num_env][b]) > 7 + 8 * ps->iid_quant) { - av_log(avctx, AV_LOG_ERROR, "iid_par invalid\n"); + av_log(logctx, AV_LOG_ERROR, "iid_par invalid\n"); goto err; } } @@ -249,7 +249,7 @@ int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host, if (ps->enable_icc){ for (b = 0; b < ps->nr_iid_par; b++) { if (ps->icc_par[ps->num_env][b] > 7U) { - av_log(avctx, AV_LOG_ERROR, "icc_par invalid\n"); + av_log(logctx, AV_LOG_ERROR, "icc_par invalid\n"); goto err; } } @@ -278,7 +278,7 @@ int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host, skip_bits_long(gb_host, bits_consumed); return bits_consumed; } - av_log(avctx, AV_LOG_ERROR, "Expected to read %d PS bits actually read %d.\n", bits_left, bits_consumed); + av_log(logctx, AV_LOG_ERROR, "Expected to read %d PS bits actually read %d.\n", bits_left, bits_consumed); err: ps->start = 0; skip_bits_long(gb_host, bits_left);