From patchwork Sat Sep 10 01:07:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37826 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp1245946pzh; Fri, 9 Sep 2022 18:09:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR7BrWh4WDOr8EFXfUf91hEJwYO+AqQBYGWmhoY7BJcU1B7mMs6SxwasVCSvAWqLuVSV9Jle X-Received: by 2002:a17:906:fe09:b0:73d:90ae:f801 with SMTP id wy9-20020a170906fe0900b0073d90aef801mr10974119ejb.699.1662772172326; Fri, 09 Sep 2022 18:09:32 -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 w4-20020a50fa84000000b0044ee88a08b1si1532812edr.277.2022.09.09.18.09.31; Fri, 09 Sep 2022 18:09:32 -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=RuEw+RvT; 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 6AF6968BB54; Sat, 10 Sep 2022 04:08:09 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-oln040092068054.outbound.protection.outlook.com [40.92.68.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A32AF68BB3E for ; Sat, 10 Sep 2022 04:08:06 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZeVy+PEn9LzqUhgGcUmim4JyO1VnSf9pLjUBPd10Qnx4R0rfe4eoheXjA6QORZF2q/rrBsOh1dU9fGuHUJTFkjrTjPKQe208hiPnLI6HqXEQDH8WaXcNae1prWLVLDvyOLle1EdaWoJIOyoCu0gqppsrtYcIKic1EoPLbvxJ3HGf/fxhKABPLHWBtjxNSe7Tbbo0VAWMUtXwz5FnDigcXub1RfcwJwbBvMhtV22D4Ao31W0JBlYgE209B3Gg9VfCTNGVs/1quHadDs+GO4d4VwZp2Lvcod8S5FAs+rBVdmYVNPF478ROjYnWCCSxZfzL2oZkfNqPfeLzAW1whbeJqQ== 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=OB+Uot9yZorNmjfvgFtVP2mBAOPBBtbqhVAYP7/+LFc=; b=QhhDyh8TMQXdKti4FTLJRIlT+BtMk8oYsbP6Rmi07y5H+Spd5olmHMwiSda5UqTa8+7hnjc0PLbyJsskE8GtaxAaj9kARvqOLTZWZxKTHsS/CQjgMbaI0GZ9F/V1l+hQcLIiUh6o5WdF1GOpWIqMcygIeloIMnATrwn8D2hb31yCw7oQHPHgApUrgBOgzb5HXaRyaCo/dQ4XeJ8sWQTBCLjBJ/xsdeyirKqxmEWq7241A99HgXkTL6XghhenkH487qOUcOBuDn0xbuUXg33Wb7LVk1w8IyQ9caOgAoZz9RZ00eFZSi7d/y3f/rwnkStdeaWpfkteUg3m0eZKCMiPYA== 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=OB+Uot9yZorNmjfvgFtVP2mBAOPBBtbqhVAYP7/+LFc=; b=RuEw+RvTzy1HyEeXQb6rIzj9J5376VAekqWcNKPzFwoX4qszuoX+atDVPlWGB9ndNIbF1msCWMyE8z2JeB17+cyxrCTy+Opi5f3Dp2YWPe51KADEBJnwVgwNcHGvotfC/wkUSr+cDXo6olHJFHBqsGb683o6xQG49nN3CZhD7q0UiiA/tEsopMnoWrmFuw50yEZRYd57GeCN5/JINgBeOerbCQkc5KCPYcm1ToC0q5Vg7zukd0jVEV1sH7Kh3xU5f36xQrvfidoZmD8eo7plPCghkJ7JLedV8Rkhp5hCSL4psJXhhSb0dzuakoTLLHBr/JeRj2tU4PkQXA7fXljvCg== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by PR3P250MB0242.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:17d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Sat, 10 Sep 2022 01:08:06 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::611e:1608:45cb:b58a]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::611e:1608:45cb:b58a%4]) with mapi id 15.20.5612.019; Sat, 10 Sep 2022 01:08:06 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 10 Sep 2022 03:07:25 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [adSBveOCkbUvxmXprrJeQew4sfXTzct25dDh0+rZiW8=] X-ClientProxiedBy: FR0P281CA0102.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a9::18) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20220910010729.2961339-13-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|PR3P250MB0242:EE_ X-MS-Office365-Filtering-Correlation-Id: 1764fc1b-fa2a-47b0-ff16-08da92c8eae0 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9Xmqc989vEjNQgjm661f4SJJ4Q1ndWn/48CD8eIkz+N2S0JkHIEhdsQ9r/qCaPRu/aNV4xbnBAipQvwI3ChGg9E2MOUmHr3fWu5H9wglLBxBfnPMW5VwDjUrR6g5NfUKHsp+f9cEspHo3vShbdjgOSlY2jPC058e+9Ix8kBJwVD05hRzYNHv1cuvpCBt4agWl6zsy9VMTj4I5K61LJe1afLf76HCPKd4zGDqeN2zVeXZ20/aESWxa1cUKyDP0pClqwyxihtg/CJVQeu9nKJLwvQ3JIp6Mvift7s+LdKcGDDJG9vYTX4XWiwcQ/ckjI5BDWXv/AXARum2VmtNdIxJROCrn66TxoH6rP/MTlUC1a5iPlf3yKRCf4y6K1Cwb5rSUQAdUO51E6sVtv0w8WV8KVZcbZ+8CMO6fwDQ8ZQq/Lu6d4awiKUvd+aSOE4E2N2KcNYgFblSBB7rJGAPMPf1oHOOklRfqKfCfg/BRRlSNLm4+QlkDsa2r1MUIMF7HVBDlcanu9DzMZqHtpZssdXT29LEc1JOEZHimM0SMS4+aXn8bpTK+tIkBEZo3l7Fwt5ZaDU8JDfvrLhRZU/fBk1/9Hp+3i+CrRfZY/ddC8pjhcIIwZpG6fiia69I0EQ26yPVrLGfyE/pb4yrkEkbWEkHV0sndHhbGXW4lyzxx4pRFGjZVJGQwrW/VZoEu16itwR+JU2X1VJ4VxaaWIZZdE5oj1pxbH+0P5KD3k6245mX8nnYgt6zDlhWrGBNwQev6ki2SsDA= X-Microsoft-Antispam: BC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Mp1oxL5nO11DTUXUdxBxsrJP2/mwSiDQu+YOP/FzaU28xXUsGW/b1lxPokN3jAjihA3ms8u5eufrTtssuMddMKyfsAmeLZIKFHHXqtVeK5gtAG+k4XGOU4nx1vST2XpuuxyEFWt9WWprAF8fH7M8RDaDMPZqx06lSU63/599kW2RLyygxcnB/bxmRoQUSiUIqOXC9UAwS+6s/STZwjaRRpr3r3yH6H8av2J8t9ESJ/agvcUW+48eeOzrdJvIR6jFFab3X4icbkeSKWVTA15zI51GfEm1IZlKtgE3FxXXK6Kl1H2CKW2t/7dDYB0SYrPCM4S6Ao8sCcnl949UN10MKvE3vzsN1OQwdCQdg+GDqlhkfx6fbKUnMi9FJc+rGiWT1WCzT6Bj5H+1DV3e82la8MAm+h0H0mrjh+iglXDP3pjbfPHcelmuR9+irH9BqzUQj814kItqPFlUJtgenzhLvMDC75Jfof3oYTYhgdzjJLlUqdFfFEZj3BcLCDI4JXksnzr4slban4vx8e2CeolOuX1mVvAAMkHa/FqPbcT90WlQ/p1S5unqMq+W4NuIh2Y3R1rVFwQOzIhRFf/kdzoRbBHhufFCodNFspgRH6F0XKhUSt5XOaCNe8SalPgOCepKf65FpSeDQmoKmb1pNtXi2IgXMwqKXEWUEhJODsGx5OgBMlZPIurZOHSyjV4YhuPwrOl5w/QejOFiN8I2Luc01xIy4agxzNmNL1eH3UIKr3UFElm61QRTjDjicdbzd/LZuOPClUqlonQzuq3/uUCwOsJxoc8Z028d3KTT3tHxQAK/THzzADunLly5vQXnJ9tDTMNGiDDsdbPgViAIKNwGCqyyf743bXCEpfAMEGRp/CSspQ9wyFBknOcDQH3lFcqH5eXXk6XQFlSorVvh/WEGuM0h8De79JeSSa++qcCpjPggPfJblOSjzAqVJxHqzDEWBDB6x62YJ6u7rZw6b7q5vyHdqSu/1lPABg1NpvggajsEVilo2NGvN1yqxVDrts0a X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1764fc1b-fa2a-47b0-ff16-08da92c8eae0 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2022 01:08:05.9793 (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: PR3P250MB0242 Subject: [FFmpeg-devel] [PATCH 14/18] avcodec/vp8: Move fade_present from context to stack 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: cOk1SLK5ZPfZ It is only an auxiliary value used for parsing the VP7 frame header. Signed-off-by: Andreas Rheinhardt --- I think that vp7_fade_frame() needs a check for whether the previous frame is writable before writing to it. Does anyone have a sample for this fading? libavcodec/vp8.c | 6 +++--- libavcodec/vp8.h | 5 ----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index a7df4601ef..baf9820ce6 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -580,6 +580,7 @@ static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si int height = s->avctx->height; int alpha = 0; int beta = 0; + int fade_present = 1; if (buf_size < 4) { return AVERROR_INVALIDDATA; @@ -679,7 +680,6 @@ static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si s->update_last = 1; s->update_probabilities = 1; - s->fade_present = 1; if (s->profile > 0) { s->update_probabilities = vp89_rac_get(c); @@ -687,13 +687,13 @@ static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si s->prob[1] = s->prob[0]; if (!s->keyframe) - s->fade_present = vp89_rac_get(c); + fade_present = vp89_rac_get(c); } if (vpx_rac_is_end(c)) return AVERROR_INVALIDDATA; /* E. Fading information for previous frame */ - if (s->fade_present && vp89_rac_get(c)) { + if (fade_present && vp89_rac_get(c)) { alpha = (int8_t) vp89_rac_get_uint(c, 8); beta = (int8_t) vp89_rac_get_uint(c, 8); } diff --git a/libavcodec/vp8.h b/libavcodec/vp8.h index ed79bc79c1..db0155237a 100644 --- a/libavcodec/vp8.h +++ b/libavcodec/vp8.h @@ -335,11 +335,6 @@ typedef struct VP8Context { int vp7; - /** - * Fade bit present in bitstream (VP7) - */ - int fade_present; - /** * Interframe DC prediction (VP7) * [0] VP8_FRAME_PREVIOUS