From patchwork Sun Oct 2 00:04:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38498 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp526341pzh; Sat, 1 Oct 2022 17:04:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7kchv8RhboBz5gUl2v9KzcjWZiQHz4YczsT1QeUzhwCVE/usUCZiT451yA1rXdtpOu+AcR X-Received: by 2002:a17:907:2724:b0:779:7545:5df6 with SMTP id d4-20020a170907272400b0077975455df6mr10867811ejl.325.1664669078188; Sat, 01 Oct 2022 17:04:38 -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 n11-20020a05640206cb00b00458b74239b8si2052448edy.174.2022.10.01.17.04.36; Sat, 01 Oct 2022 17:04:38 -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=iK3xhmm0; 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 5F7C168B9A5; Sun, 2 Oct 2022 03:04:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2083.outbound.protection.outlook.com [40.92.89.83]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C2E2A68B903 for ; Sun, 2 Oct 2022 03:04:26 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M3Es5to3xi8AgkDzdZH2lxx3p0N70fWZsVYuQ0VQdGX1JeqUJodKfpa7b3PbeSrZ9DADEZ6bB4Sd++9EZFgyLDBu+AP94U49DAgyszxT0vKWMWWqXEh7cwCwicXi48mKIsw2ZnLT8j185cANz9XGvzjWbBMbS5Ia4hAMIhgQ/gHFW1gkenNDxlAavo5sP+cfShKjmnkRl6d7cJHKNhY3RKI/ai/qLzNjYy/nDHQiqozyYs43BVv5mQLocBHDTD2Iz+1KROfAePu7g1A9C73f1mm0vkCnzUrK9eyGYBmm3tM5UpUWUBtf1/kJvHKu906scJak+BDjs2Jxfg+c2OidUA== 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=QP63tnkNVbSMaKdh7efzNoHbKz5YWK6CwQp0HyWKfXo=; b=TaiZ7Stj9JNJS7iBUF5tKGjFDe+QhObKGppkMOlF33aMXCJcz46+9RxsFN54o9in+9PPbaef6Xf2+7Mjdsw9fM5Ybsu6ZabD6n7Y+1+emv5ZiBZYSkxe/jyc9Gq1NDpCcv/2Hl++zTGp9LA9qKV7+8UEnAmtvyO69diAGh+BhxjiqMrNJgwGAlCuMN9aqzsCHbjVZacqYfAb2Y03Zcx5Sci3H4KYuuvV2Uz6IuxwdiDdqfxC0r1Vcivh+WV9l3JkByrF/OjahFVluupdC4J9/p8kZxwUFqzxe1lVD/GiRWDQDmuTbYF+QOrUbxC0OZ+vgwaYZYOpToF5lUlyYjoc3g== 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=QP63tnkNVbSMaKdh7efzNoHbKz5YWK6CwQp0HyWKfXo=; b=iK3xhmm0VgWkBCGhVfxNpOEkjMjNzM/ww0lucGksFf9AK793bYLvAIMNar96HOSup7jNbDlfPLSvU1XOmhLxzzOPHs/NICSPhXdsIqGh0oZEP9mdGiflr+fgH9F12WdexbZvg27XbWJB0vdC1lirpzP08hKS/YYXGPaKP5i/ZudsQ7+094KUJnEv4yCY9101wCozllLOR9tG6xAZ8HFoxjmB1DVOo1Czc4zNroap2K7glNH1nLDpIK2UHmAWNyduk+AS5/eUVxn4rj5KNGj7nBv1z0XomxsN0kHBW0I+0WRTeVsbBJ3jaHpSiQXGF1PeAe+F09/Y+EykOVKNcv9fLw== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by GV2P250MB0997.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:d7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Sun, 2 Oct 2022 00:04:24 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5676.023; Sun, 2 Oct 2022 00:04:24 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Oct 2022 02:04:10 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [kna2HliQkWibfgLcxUf9AIKI4StABOzLmCTvvA2kYfU=] X-ClientProxiedBy: ZR0P278CA0043.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1d::12) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221002000423.469081-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|GV2P250MB0997:EE_ X-MS-Office365-Filtering-Correlation-Id: cde5e1c8-6cec-49ed-2667-08daa409aa3f X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqRS+LhpAttTUY7UGhdHTSoZ1gVR8N0sc9FXjkvSIzUVYuKgnQH0uB+kpXobjR7JFyMNclMFpuRFYyZfH+iepyNsiSrdW7GFZiPidznZPrpJ8bx+unpciEb2/yL9ZquixkDfesqTjinjG2QYTdieAlB+PetXDKG5+Co1/44Fh4UlQhf4kk0TMUxP3EJbtgOplnRStOFGRZ0ZIHRQU38cnYlrw6+G3mDvhKHHMirH+kBhKCR/CxiNdsieBSlt/PbO3JKKscsR292ivIjTsR8OAsY150Oh7y5vcpPqCe2D2JFXFcnEalpntm0v2ok0QPWc1wzKHrflSWzC+DjlfgQKqS3abdmz+6h6+d0KpsDxR5Z1f1VniiMBPvb1KC4NeRhCuymH7gxFdBkrzfmLkc5lri8hnmPdRHKpEUEBgJs1rw6o06o52VdUxNcNjjkyNiesibU8EWb1uzBE+QTDFA4hULxMZelnz7RpbFQC/T4psa7x4m/WMhJWRYne27252u0gh9SRspLKFbMjRq/d7GS1R7XbZqJxyjj2QlUm7KSLux9zwF81O2+2eccWMfRPBWqNQTHXpHEsK2hpwbUib15mlCNgVBTQ++FA5eCHG24bzd/RAujiNZ20iSxKbaq8njIS7XBnwePu2btnt+Il1/vL+VQgWkREXBVGU3Mm8C/X5f4lI7+P77Ur3bdjRcqt9J3QTquvYtuOA6Ml+vD9n8ZZYdzJMdp3ihuEEhHRV5O09rX3tdp34fJr1f9gaVEH8+fXqA= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eAuzax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5e1c8-6cec-49ed-2667-08daa409aa3f X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2022 00:04:24.7566 (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: GV2P250MB0997 Subject: [FFmpeg-devel] [PATCH 01/14] avcodec/ylc: Remove inclusion of huffyuvdsp.h 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: p88IAD16sGY7 Also improve the other headers a bit. Signed-off-by: Andreas Rheinhardt --- libavcodec/ylc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libavcodec/ylc.c b/libavcodec/ylc.c index 3ea6749ffe..29c10f05da 100644 --- a/libavcodec/ylc.c +++ b/libavcodec/ylc.c @@ -18,21 +18,17 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include #define YLC_VLC_BITS 10 -#include "libavutil/imgutils.h" -#include "libavutil/internal.h" #include "libavutil/intreadwrite.h" #include "libavutil/mem.h" +#include "libavutil/pixfmt.h" #include "avcodec.h" #include "bswapdsp.h" #include "codec_internal.h" #include "get_bits.h" -#include "huffyuvdsp.h" #include "thread.h" #include "unary.h" From patchwork Sun Oct 2 00:06:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38499 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp527057pzh; Sat, 1 Oct 2022 17:06:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5d3pf/VYR1hyXbVdjrf5n9bLOqvccmQiNa+zVlYYvjP/1P+wr/kH9b8SkVCfGCpENZMfDb X-Received: by 2002:a17:907:80d:b0:73d:1e3f:3d83 with SMTP id wv13-20020a170907080d00b0073d1e3f3d83mr10705562ejb.372.1664669191719; Sat, 01 Oct 2022 17:06:31 -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 k14-20020a17090666ce00b00741d9a1e2dbsi4113830ejp.1004.2022.10.01.17.06.30; Sat, 01 Oct 2022 17:06:31 -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=dHXruYkM; 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 983E068B9C2; Sun, 2 Oct 2022 03:06:28 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2026.outbound.protection.outlook.com [40.92.89.26]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AF72568B9C2 for ; Sun, 2 Oct 2022 03:06:21 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bQ1fk+IfgRJI3HMpSCUjQz3ZLgAjD9Hn6YcHJ7Mwwj/tenBOUECWTmZBEjQSjPPBgK0ZDPnRTDV5vMd/BqeZNcTTaSS+xcjiSxn/WomYlj29UW0CKYizqDX0wOntA163DRnCbngefG0YDdwrvC20P4wVNXWPgiNLLCaK/XNw3UuVcAMza0A4qi0evGYO4DkUcOE3irnYfCYR7G/UflpvrShpOufPWh6GIUe2dj/ojdpmRPw7GIZvzxouIuir59lknHykvmspkRHfup2QcXaMHAhiikS8y7VTSFY3NB7ZtmtLT4trLKerDyYgZaBiuwzCCnfQ+Gh5Ne0r5upHatP2LQ== 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=0WsoXjtzF4zTUeSD86o1JGP1YhCn1Yxdx21p7aXOlZc=; b=lMY/CUb1wwg/GpwXmhwazmqhIjaStWEIqFeRizpjYXZRiyjIQGD0m8sxNxwgNIX9feGUH6wwSJvhESK+HNvWL+aL8lYGYut/Cd6aGiE46AAF/UlzMVQAbRg3rpsFKEwtzG+xOKIrXf68CUkPEzYCrTa9EnHmVLJD9YACsjybpwfbKp+qvRKYGRLSsSFN6hkXm+axv3YUq4yLgoA1s25LHt7eVbnVGP0k+zn+bsCe5RWo4AwKZbY90RWgVbtzGB4rk4qbb3RMvD983E6ukdZB8wuNXa5PpZYDKtkkUmE8yK7EJ2FLhQMBpUGifREqfJQr6hfdJjbMNMg7WJFPWLEYpA== 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=0WsoXjtzF4zTUeSD86o1JGP1YhCn1Yxdx21p7aXOlZc=; b=dHXruYkMXUPmk+u0XtsKRe4M/IrZz6nV3czWLlwcYEdfaY99/WO9UDesJyyzJrewRIeaOShmHz6Bv0EufQMqHndkGMC860pro1WrBMxl1FH+MjlraNA5xZeA3+GljwQhXqjVHyGzl36MZLXCKzjCl4Bh5j/YMfMY2DP6jSRhdXccct+Rhl9/FWemq0mnDI0ewQT3j4RTbIiQGlArpL6XU2K6Upjo9jXFfiyj5Lus0akmytYrTqXHZ3HMvaZJAfGNZgkt2RWNnRHF9pAwrbWzyVe3kvlpEcGblkr7ZG/3MmU09T7oKpqbyT/OP5UiIpTkdcbrUtKuYTdOmsXoR2npIw== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by GV2P250MB0997.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:d7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Sun, 2 Oct 2022 00:06:19 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5676.023; Sun, 2 Oct 2022 00:06:19 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Oct 2022 02:06:05 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [pD5I6Ng9Pe4HJPFmmXyKEzddgF+3v/Jhjk3up1bTxDQ=] X-ClientProxiedBy: ZR2P278CA0010.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:50::14) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221002000617.469194-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|GV2P250MB0997:EE_ X-MS-Office365-Filtering-Correlation-Id: 3307a413-e679-44bf-c1f2-08daa409eee4 X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKx7KypBKN6CnruNpK5hV6MtjxDdSzi83JwzaeEqQgwCuSoum7S8fCS9dV3+Rdkmqa7fvKd8QA8rEaB+QaXk7xqhMLgW+SZswp2IoaRMCo04CjEgy54cRW2tv74akU6b1EIH+MObo01U/ieMFuu8/0XdjzIhmrBocKCKfyOjCEX94EmqyRsuBK0DqWK39kH3iANJ0+hkGS+CYAB1b6j/GvrAGqeTh7OmK+pQakp2m2SlDKfs/gp8pW6/6FODzwVQFLB1aMcUnn+yTnqZDLHIPnWkeZKUqr2Vq2gHdLYiN+XtbenCInA/lC7iq19+JeoGGGel5uNGEOIcrLRFRcIoheZ+fJijvCSxnBmDGhHs5YVOtE+G2HgaLzy0VVz8MxCssBP9jUvAq9Dm8RzEIbIsHS1tXCBh9bygpJN4PPFlpAxZJxBJ0n/wGvWxFhhMoN/OmOwBkPgJ+mLA/PqCDi1tiD2ZKcZqmZts1QX6W0UosSa+joZ6qWxM83Mkki5d3kgccuPwva2Zq8e2atcV0uMb1r+AB3E/JR7XJOXucXolrE0VetrP6WqtfJlsIrhDSxUrxNkvXfv4908gRjtBPb3WY7x7P7JDRsbLrn65gH1P3wZDZ3tD39xig007EKJZlO5enFSttDeCBH5h2KYYkzKDfK+uByGMYPG7Gf62A1sYzDdxRDy8gmvwFSrrrwDwFa/FlccablsXDWw7zhnQmCwTOxMyTx+qtwdQNLA= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NCLYslJo7/RBkYcIJzVhvRWtap3a0zueKwd7WVBIx/KNewfx9DZbSDKaq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V53BUTcUUCDEwgIxlF4hkEyE3kmeaUxxNLyUoAbtR2a/Ge6a1Y/jZ6f3YjW7WgnPMUUDkMm2bYSKFlD1MXS+9hTJ9jHcW5kXmM7hkn+Rv3Oo8Tt/P1yU5MsSpFloYZRtV4ieVoDQenfrpAQPz54FDwMV65Y6jfL1KuAeoPNhD68dpnTUf++1BguKluWG+Yu5z5ddlOAVP+XqI1k8AaSn9o8D87WpbjIUlw9Beox/SzY7GOR0If7FpSkbvawX/njmHz4xwdizRruGNQi5avJxN3qPNMjCDvaLBhpRgVBDeS4o1QPPDduRmmZKn6W7BRMtQTJdP4DpsjGLUdCSd3Jv7VuNd4eL1Rb428cxkfcve8K4Tg539Ra2oud8ZJB4uiLkGXGDb9GjRDV5RmHv+8aBKMXm3IkTebbtQ3TqDHWI3qsBz1vp87sFTTQP+SCHzDiCDRMDdipZr0/CfTLbsTO1DRBhlA2fhQOBG3GhX1YwAG2/Q3Sgilm5MB7V6JLWYz5yDn1PbE75kswUP0roMi1kW73YBPGNKBiOhIPqheXuBSPwUW9wzLXb2GbaZCPcVsbk0jVhKaM3h2z8owe4y5llJQKXdH52GCXX4wERq5F/W3tMzeYUyODoFHkZMNJOz16RCFDiF2aOx51jQSQZrdw8rSwa9688PsDfd0IomWH8KlQ7NF1b4uDzlAcQZmXlR819TLzZ2WAloG3utAU9Tn41q2TvN5o+1X0QmgPGtnaem2aqewtwteveeaxa1+QQhjVzZOOcheccUJRVdaUwyEW3aOlE+AwWebJfiCBIxATl6BdmYdu4rIv2pdS+LPSMGbqegl2RSd/DtTRaa0oQS2FCJW1owr0W+WQzppOOBxhu9Dj7QuyD6ZOki32j8AJwjRv3spYnxAUUi4sE2eEOgDLP6QQK/cylftHPx7vKouZBCeppDXn/Zm3t/9k/NeQ42BrbvcDNCa/ X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3307a413-e679-44bf-c1f2-08daa409eee4 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2022 00:06:19.7695 (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: GV2P250MB0997 Subject: [FFmpeg-devel] [PATCH 02/14] avcodec/huffyuvenc: Remove redundant casts 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: uOmhUVTs64zQ Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuvenc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index 2d63b12abc..d159d5d309 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -333,20 +333,20 @@ static av_cold int encode_init(AVCodecContext *avctx) return AVERROR(EINVAL); } - ((uint8_t*)avctx->extradata)[0] = s->predictor | (s->decorrelate << 6); - ((uint8_t*)avctx->extradata)[2] = s->interlaced ? 0x10 : 0x20; + avctx->extradata[0] = s->predictor | (s->decorrelate << 6); + avctx->extradata[2] = s->interlaced ? 0x10 : 0x20; if (s->context) - ((uint8_t*)avctx->extradata)[2] |= 0x40; + avctx->extradata[2] |= 0x40; if (s->version < 3) { - ((uint8_t*)avctx->extradata)[1] = s->bitstream_bpp; - ((uint8_t*)avctx->extradata)[3] = 0; + avctx->extradata[1] = s->bitstream_bpp; + avctx->extradata[3] = 0; } else { - ((uint8_t*)avctx->extradata)[1] = ((s->bps-1)<<4) | s->chroma_h_shift | (s->chroma_v_shift<<2); + avctx->extradata[1] = ((s->bps-1)<<4) | s->chroma_h_shift | (s->chroma_v_shift<<2); if (s->chroma) - ((uint8_t*)avctx->extradata)[2] |= s->yuv ? 1 : 2; + avctx->extradata[2] |= s->yuv ? 1 : 2; if (s->alpha) - ((uint8_t*)avctx->extradata)[2] |= 4; - ((uint8_t*)avctx->extradata)[3] = 1; + avctx->extradata[2] |= 4; + avctx->extradata[3] = 1; } s->avctx->extradata_size = 4; From patchwork Sun Oct 2 00:06:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38500 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp527233pzh; Sat, 1 Oct 2022 17:07:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7prl0COqX9lVqwNDBg490N45/RFlJP2n+BV9qbzfONiUtZHbUTIPt4pZP7emnKHIMF2Mt8 X-Received: by 2002:a05:6402:35d2:b0:450:be1b:d7cf with SMTP id z18-20020a05640235d200b00450be1bd7cfmr13275510edc.51.1664669220683; Sat, 01 Oct 2022 17:07:00 -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 gj3-20020a170906e10300b00741a0c28f07si4320213ejb.943.2022.10.01.17.07.00; Sat, 01 Oct 2022 17:07:00 -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=LdJtD7xd; 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 8B96768BB3C; Sun, 2 Oct 2022 03:06:58 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2061.outbound.protection.outlook.com [40.92.89.61]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3FE3B68BAB7 for ; Sun, 2 Oct 2022 03:06:51 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ScAl7Z7FQwkOiKeovBuRey2oQcQJjtSrOVHZio3NhpNKNChNukHXzv+NzE6LlbpKo7APPKPpSjwEg+11to4KOodFxscPA0TkxfbOsEzBJkWS7Y3o0oVNncgNEqARNIDo03o6V28GAlDUo0GtU+lzYlueK7cZBjPQ1C+1DdaFWno5QgEb8oVN8fpnUS8XV7Ja8k9eWLMx1KjWJxkEsHL7YGDlKXQHDwN83NCCvROh4wwQw/oiIi/zhlu4rJVqZtke83R6jlmV9U+o+AKZj6pGz4SeyPOch/bH9TfGIzGUjagxg06zdKAMtU7gMA6Zz3kyzsYRKe54ANwnjhsM90fl+Q== 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=Fnbb+mChbAEt1J2kxTpNK0HdnJgC7PUs6z7ykzhU9QM=; b=C1V7l5OvmlgXbtLb4I980bjiTNo1GldQC87tMUuNCO+TBz5KnmAhDfeLzizISip3fMKlTVEfZEUU5iLMcN9d5tOwKYzh5B18AXS9TvLuJkYiP5RZaT69R6L2462z43fuKKGMy8owui1q/61bGhtXzDCFWrtSYXrSrLx2cKr9wwwlqjEKMu/MGXTCR3En1UMlRHTIfkk8nCBc64m8B64BspklUzJmpP9V9FB/dywwoPGpppdkV2PGs31RbUc70W1UhzPs1L12xgjbYa2COL7SNa3sbeT8mwTgyVeKa7D+WZcMz48vhuEQV5rsjHGOz45gsfEeSnXW52OymQ6O0dlmwQ== 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=Fnbb+mChbAEt1J2kxTpNK0HdnJgC7PUs6z7ykzhU9QM=; b=LdJtD7xdTkoljEkyJuunRSAQ6V7wis49k9Aw6hXSx5eJgbiay2+9Hyy/y5QQVmEKAWC2B+jdLmPNs4Hh2Z95TStkMMRF9rHq8jI+C6l6bERNK/qG8/wd22Oj9etn6FjrvazAjLUUe/wwmPoC3NcvsBgnb8rcW3bQHUY4Kb/QO0nKlTrqkBS2qxPV40uzJ33etardy+/zSA5SqiicY3Q8KdaCs9vxsMApjr3FrtdsLHvGffayQW7D//sNscfMP6p8gv/YJRQmzSUsVmLN/mDgmajU6KTQL/qgZEajOu5h7Sk/9YOTGhdrkrV7BmbVt5XEEkM3W7OQeJJt6sgQ6JPQlA== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by GV2P250MB0997.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:d7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Sun, 2 Oct 2022 00:06:49 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5676.023; Sun, 2 Oct 2022 00:06:49 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Oct 2022 02:06:06 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [9dL36wrq7YHrtr1bXaFbBWNyl4cCMCgp] X-ClientProxiedBy: ZR2P278CA0010.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:50::14) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221002000617.469194-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|GV2P250MB0997:EE_ X-MS-Office365-Filtering-Correlation-Id: 51a7ffe4-63cf-4d46-a602-08daa40a00b0 X-MS-Exchange-SLBlob-MailProps: feAVlmA1hHWSfbl/QmJp6meF5MXcUmj/3cScuqp/+1PpkATnNmpKwGXCTofVpLSWt7x2eDePPqsj2TrQqYgSurrAdO6cYS2yTYzayc1PKOPHPneJfMYgHtVTutU/Y4Hv+F5UMQdMhY1x3ugny/ksK+4oPca3EG+iCE1bhRBo5mML8WonTmi03lUuyT/UrPW2IUEnNdzSrsY7zFh8uNGVYJE4ukI8oc0NW955qhQrdbHhLtsF9ag/40/fTJ+FI0SJtV1ejoMEJGqlT0kii/H5wS4dEbqYJd9nvgpTQ6uoKNrag4MvzD9bJg320umd0j0+TmKacQgEoeoG9mUtyN0uV7dozE1myaVIgeqmjaGzWvKvQYIqhEjHgPyWPJaslGygwHXCL0v40v6m/PejjQLvaQb6x6tw0A6ASc1QHfvpYu4bgKVBDPQE72pdkQDO8oEG4QHzY1rNCAqHSnLe0un/8cRF3wZ7YA2gnXFFZfl/liCNek/rKIr8A+EJLbIe29GT36mLcMMWCjjrhv4UZwg/gm2b9ggA8BQWWvu/ipGF3E+rsMKB0EH5MbFsInfb6ogP1rx+LLatmHdeE0Xf7RMhc5PSFINe51puEyZa/WkMdRyJ2TIAN1hrLX49htTWvIJCvYzupKsCQc9ft08IHhHh84wGP3ZfYm7pmUxIsQNmfBPP7/qnYC8LDADMmtENMjk1v2ChgbEcWBasx+ZCcxcGgw== X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9yvthNXapGsKeisrsCTMo3kkFbZAAvx1XJ8tqHc4yNV6z9O5ZWc8ah4tnfEw2yDz6sagx5VFuL1lu1BHeP8z/XuZrPMjlks6GGc/7qP6x/ZFUIK3pjJ3KDOnulwLB0LtiuoScMr5D9XYy/NbcxK+4GEWspkjWyime8n/ivNDqs8gCOlMOonDzbrquCk0URwTs2I+QD0vOw+hDshFWzZts8ZBwRVe4cVGQBSMZxK46qgghim4OwElUuy8DfWPltD4ddBjExl1VPpUUazYGAloLgZ+bgqnEgGaHQHBlgaVyaoU1vA+BzGkWSk+Wg7/wakeThRq0qpljYLbuQ0KEvDmx9TARzRLoB5Dfi1Xy9lsVQSFbl+WYinlIv+uRRx+C1XSiYekFoB9fgyEI4FikyLq58VvCrgRR4/g60AvTBsg7yXjUMplRpk2Kr8APFABqbitUIO2LD7p9gOsLXcZrom4BRM0a517GgapRrqBiHrErdDX9VSCoZ9uLBCrhmrPotRmuv6Nw6AL0v7I3JXIGWC6/VJ/zeqLcgXl1BOgFaLapgBqrcBMBkxt0di1P2rJhxEmIoOqaT8Nueuax/LALlg19QHzcowgLU2eIgcBK8BrTJgwbYmTGJA3q1VdBKaAtpmUjT5/z/9BYeb4D/BxH6Ih4RH8ctGVX+o9PvrtJ+ofNFa/J51rCU/Qs0vzTG6QUma0 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xEIf/+R2a8nazcHqYPouNObdsIwEjrfyh79qZy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0w+BcauQF2Bqfem2BqzNZ6XrF8S+SE4W0LMHvKWHIB8aXIiR6ylSdx8u1LliC7axLZN5YpQ/hDgxZCbwj8BtxNBATkt9Xv92a4j71snMFdc1cixwVgEyPjxApDfW7t9kO0oCD/ySPsynWmcQRU9ySZG7wfVj4AVZRIo3ASb7QX3aNMFo10HPQ6ecVRo16unT44clrVtZUBGzIbBFsyZZytTh9zJ X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51a7ffe4-63cf-4d46-a602-08daa40a00b0 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2022 00:06:49.6738 (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: GV2P250MB0997 Subject: [FFmpeg-devel] [PATCH 03/14] avcodec/huffyuvenc: Avoid pointless indirections 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: btSPa+sLgR0G Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuvenc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index d159d5d309..fa4923962f 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -348,7 +348,7 @@ static av_cold int encode_init(AVCodecContext *avctx) avctx->extradata[2] |= 4; avctx->extradata[3] = 1; } - s->avctx->extradata_size = 4; + avctx->extradata_size = 4; if (avctx->stats_in) { char *p = avctx->stats_in; @@ -378,10 +378,10 @@ static av_cold int encode_init(AVCodecContext *avctx) } } - ret = store_huffman_tables(s, s->avctx->extradata + s->avctx->extradata_size); + ret = store_huffman_tables(s, avctx->extradata + avctx->extradata_size); if (ret < 0) return ret; - s->avctx->extradata_size += ret; + avctx->extradata_size += ret; if (s->context) { for (i = 0; i < 4; i++) { From patchwork Sun Oct 2 00:06:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38501 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp527279pzh; Sat, 1 Oct 2022 17:07:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ogC+c/81xWm6d3C/u8hWO7qV82KyRimEtagnCqgneAJGKaNzquN0A0kxSie8L1F7x5lJd X-Received: by 2002:a05:6402:c4d:b0:457:99ec:1837 with SMTP id cs13-20020a0564020c4d00b0045799ec1837mr13124510edb.86.1664669228728; Sat, 01 Oct 2022 17:07:08 -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 o12-20020a50c90c000000b004584e4d62c3si4586492edh.187.2022.10.01.17.07.08; Sat, 01 Oct 2022 17:07:08 -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=kEhLCb98; 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 86E7068BB4E; Sun, 2 Oct 2022 03:07:03 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2061.outbound.protection.outlook.com [40.92.89.61]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6CBC068BAB7 for ; Sun, 2 Oct 2022 03:06:56 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YAfVil+fvIXtYRD04VlyTFXuURvO1OT6n8sP1WslX3QYVK18xgZNAc1eyZADvUPz9Ssr6ZuYSGK79F4d6l9iRZ3SZ/R/2zYdxojtZ/HbiOutoILrpAf37IYWM4LDskFrt0CwIMM5Tu0oQrdAXdsQ2FzZo6y4O/8FyPEymFTIean+nLcqYl5gLWEEnwoiKyWa3CaBQzSCPyaEA599JN+83G2NrJHDf5fVLKK82TsT4H4Ku//NY+0fw90WvoG+6EXK77P6qSaPPSW9Uibg23xCAoLRkpCh+rkinZX3UKZnzNJmDF9Wd0GjszK8GS0bRAlvfB7x9KOvOh3xva0dzHOj5A== 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=y1H41RduvsnC8EBpJY91tfrDmzhSndfxuTTd4hV2a2Y=; b=iUd/Be6+qSD0EV80QozlV9rq8U5Oxys+nd/IJqGodcJC6C1RJyMRUvY4tUTccZZneuYH88J5qaagaOvwaxYVegTzVr9P0Y02tOZRRtIUdeofKu7EXCqh8KkOhpW6NY2zmaaTP+DJcU+lr2SeAhzMPNeTqPwJP3CbuNbZajl7W36J6+8Zxa7aTTt9jn61s3mKFzj0+XD4lASGpg33RthQuehjKLVYf0jupUbPzmKbPOodvrGEq6vpGfbPt4u6Y6mW8fLa7bcBDWDtnmT1qQcEuyCj3PUgc4hE9nNuPCCuUzlOFA21nX/bgVXtecoS71UxhxfA0n8yDLqVAU1ZEj5Qlg== 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=y1H41RduvsnC8EBpJY91tfrDmzhSndfxuTTd4hV2a2Y=; b=kEhLCb98A8XVG5DR+MBlM7yJnBbokez7dK4txDyYB9XMGU8FHiwNKGP9myIqqf9i18j907rdHK5oF1DcT58+mKY5c1CMGGjfs6nHgneFQauwb2XxIx+srDERscs23a4LVfXFPBTXDphB8tWaPHC0guKNWqJnwSt7wxFN2YrYT0sMhSNB+ajrsfsGzFR1z1NuChp4YfQoE8wem8OSL3D0yvKwF1ofSNT/47kqsCvujfu9quJ9wYbdsVLe0lZ491kuDwCX8B02bAk6e94OKAS9uMqwbi1M/5oQtoHIk51oR67KgxIKrFZTdmfdjcydrvWWrrzId5KnRqzC/VdZI8S2Wg== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by GV2P250MB0997.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:d7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Sun, 2 Oct 2022 00:06:52 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5676.023; Sun, 2 Oct 2022 00:06:52 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Oct 2022 02:06:07 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [rbE4cPe67DrnNBza1f3bJdcOHI7u7Qz+] X-ClientProxiedBy: ZR2P278CA0010.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:50::14) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221002000617.469194-3-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|GV2P250MB0997:EE_ X-MS-Office365-Filtering-Correlation-Id: 749ad57b-6f5c-41e3-9ba2-08daa40a029b X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqRS+LhpAttTUY7UGhdHTSoEyrnz/t78IJiEdZeG20GIDVwp2c5Nz4i0Rl75FXOESmjjX5HrTt8nzlRZUHV4x4zdhyg+zwnE0PsmknCzwRJ0bRJhm3QJtBAPVrlt91LDksNxDj/FQA7Xydz2YG2tK41tEaSlOSbexHpPLtWllhnaJM58Doe5MLUPnq6k+zyzbFfB9xDMgA0Gv6LXnfz6QsLKNvhe0oaDvdD19mH4X8hTB0frRAXYbP5b3aaSmLdvjH/eLor3ddb4LkRNxGIJYFaqvUrSS57CdehkV61XVTRMbuHA61YGSUVS8so/4GnxjL4IoPoMSi+pBEa6uRdJzlgtwTxsWB5TYumktS6tz1zLwYHxqZOQrTZtMBw+wYCdGNrCrzGYnE3hrqhQgf7cCaXX4IjZz7iWJ+VnRqSszso9ecUu+SJePXIUY34esGLQmvS4CCjoAU6ezsL7bqk/RnPX6kjlfbtRgXvgMQf5VlPJyfy5bBvAyoUSjbPSZvps6WA9ikFKRwliwh1TVOVWYa1hPWOAcl0yAOU3kHE0cALCIdXX+ljVF5kYilnQZxd0+/xbOF7RdjcwMnOaR1/EFC7zu/2VVC5RMd7SSHlf33LkgLRkqatQo9Z/AXg+uxnLtv2LWCW0ISDFIY8UZwSkg8k9AQSOo8Fn3fLtLwVYXRZdEPkkKEKMawXWsv9QIZpIFm7MpW8CbrPUydqOPuYJBukM6awohq4fPXX8kLa1VkIM7q+kaAlX1Ul4MpAtKsr8Vw= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PuipB3mA7dc1vEh3uw1Jdm1zzvGTw30csyDdxFunYpJ93xq5Lo/6uLWOPIcgVtXUrGVQSQVkFEZ5dvd3h6cNQAitnD+cpO3mCzxe+ixDAPXBVyfKspwlmDyet9eyqECvWoScB3jLdRZcBDXJkaFq825OTKGQjKorjrcwUcsSzF1UKq9x2X8DATHiDEWWe19XbYf8uixNAv8jSMVRMClFLKxnoPsSFi3nS/V7Wt8kKe6vdH5552RDO1wUReu1tcInvzNV7sfGokwJmrQzwfTPm65tTbbbCaalt6LqonYdS+3g5CnG4k4XOQECq42z0Djss5pTUu3q0Seo9Le3WNlQNmZl6gdMBh0Enu1K9l1A/qxNHI2pkc/K+thgm3dRkVjVLDhO2C1yZGCely+z3yRmQBDMZwuMUQi4+e73OxRvHIJwn2ak/DyFV04iCVv1tTIJtZd9/BZQlfCuu1KQyQmjgaX+zR2G0FbHM9WWNutpL9xgKY4E0HR4faow/hAYdwtf8TO06UFNvzUmiqfJA+aCcs4t+J9U2GdcLlxsDpCMhn6OpnHUa5IXc1v55pkI9mcf56aehpKr2t7AJxz2BBkxdHiEjfA9QfCli6RJC8q5f09MD88POKMDbDuZw+7DS2McHv2XOBdL2hJXpYoFDufyVaPUhH/2mdfsnA0BgbisHOSwosZKuix+2NVRE+bsRA3h X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wp9MtIHETYLRVFf/1Zln5E9JdrSpJMcy0bYdSjxM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BR2dAdO7cNzeejDth4g9pf4BEfF9r71iyepMQ1U/hcf9jGcsMqNA5LlnMRLyHG7PsBrAXS2jtAdZCk/zeUZ4AEPSA9ioDEyIzXejz0xdMYexLXkoNuksTzylKzxvgi3dbWubeAFx0Xq4IHF2H+9R8X3Ll4cXlQkra9BNBMcjU6lITTMJGlxzZAKLV8PO5ZQeqeU5pLGQN0AV0biQFDgeqdQeiMwIUcIoC X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 749ad57b-6f5c-41e3-9ba2-08daa40a029b X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2022 00:06:52.9070 (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: GV2P250MB0997 Subject: [FFmpeg-devel] [PATCH 04/14] avcodec/huffyuvenc: Remove always-false check 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: k9rxvHLgogxz The ffvhuff encoder has AVCodec.pix_fmts set and therefore encode_preinit_video() checks that the used pixel format is permissible. Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuvenc.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index fa4923962f..80dcdbaa93 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -310,12 +310,6 @@ static av_cold int encode_init(AVCodecContext *avctx) } if (avctx->codec->id == AV_CODEC_ID_HUFFYUV) { - if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) { - av_log(avctx, AV_LOG_ERROR, - "Error: YV12 is not supported by huffyuv; use " - "vcodec=ffvhuff or format=422p\n"); - return AVERROR(EINVAL); - } if (s->interlaced != ( s->height > 288 )) av_log(avctx, AV_LOG_INFO, "using huffyuv 2.2.0 or newer interlacing flag\n"); From patchwork Sun Oct 2 00:06:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38502 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp527321pzh; Sat, 1 Oct 2022 17:07:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM524nmb7FB+iEJOuB1HgaRoysu6WNwUIta2+lwOvtDoUdgPLiwJ9e7ph2+JftcAmu5G4S6S X-Received: by 2002:a17:906:cc0e:b0:77c:d77:576d with SMTP id ml14-20020a170906cc0e00b0077c0d77576dmr11164402ejb.658.1664669237085; Sat, 01 Oct 2022 17:07:17 -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 hd19-20020a170907969300b007820695996asi4057834ejc.763.2022.10.01.17.07.16; Sat, 01 Oct 2022 17:07:17 -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=h2X3+4nf; 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 9ED1968BB5E; Sun, 2 Oct 2022 03:07:13 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2031.outbound.protection.outlook.com [40.92.89.31]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5D0DE68BAB7 for ; Sun, 2 Oct 2022 03:07:06 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gl5mHnihfNrMYsSrphsD2Vmtf/xw1xZLGeGDqGuNxLa8WbIWZqPzXX/Q6e1K5fkayC8vdWFDn+jp26Qfr9wTxD6MW9xl2R8iJE17cxtHpweQpwutWYubjInNps2Z0cr6YY2njGn3o9vprK5hmTgbgOPH4IQPlBQXLYqFhB9P/BVuFjAlk2OOQcQP5w571sMMekB/tn0Ib5lzIpXsAp0LzLVLOY97cIx5ymlOxQd2cNkXpGv9zHtRwtxHi19s3CL539dC1ticeXgVqcsUpEI/xXx3E8DiqwMAcO9FwmQ02lj0VOAxvzXKmrc0IEPkit23VAm8lfcZpmJ/7oULjT7zKA== 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=NVT/TuyaCiyBci1draSBVnkBxk3lOn2KPrjJIPUOjGo=; b=VnCX7e1TpBLoFXRjzvS8NaYkfCqPij3FbaxkEhopPQRYx9crHg78TArEnB6L8+uVkqF6Dex0VNSXWYmAL4upSMsEOTVEBNkhPt2rIET+iFzj6E1a4Xoy3W20YU0snS2xDiF6mo0eTUo09AVwhiSuabP/yV5ynFsOkGNHJAGOCiHQ14AtIXBBGwTzaO1MjD73TqsjVIc/8T6UmUfrOADsAKpND/M6smHmwZS/Gpz1jt58GLEsRo8moWl1PdWzoFqQJgL/qnLDDxF4rZhXObv4Q877PPqOIoXUcG0CdQjS2k5JC1ZU5GVjb8wb89L9hnWPg+tvhYTBtMXCpY/9Disz5w== 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=NVT/TuyaCiyBci1draSBVnkBxk3lOn2KPrjJIPUOjGo=; b=h2X3+4nf6sFT64ReNWhxr/HTOOsdfd1dC5irnpz/PVdk3bkr7X0AsobmOGjUmvehRKZnNgUs+aiRBxZgdt0FRu3JCzv+KrEtwE4QjBAmpeXTo129dVLY1Yq/eS3z12R0H3oUg+48yOAMAwxgUkiA5maaFjAuUVTcMf7o5I7c6infKJW5Jd7U5I6EkWPzztxNdqkf0ywkFBfyyCUiIGQ7xY0FpWSjvjWB/s61YeaGEoPrE4CJY91CmZc3O5IoHTpx1IErSA90n+W8BHOybS2DPH/f5BxxockyVhx7jDtyvtGqXf5LeK4OBCYg/qbztDchMuK+9alTtpNB5Z3GEF8A3w== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by GV2P250MB0997.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:d7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Sun, 2 Oct 2022 00:07:05 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5676.023; Sun, 2 Oct 2022 00:07:05 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Oct 2022 02:06:08 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [OITzKg0iqXbi4ZGmDilDc6f0kzN2H51NbH7AUtgYfjA=] X-ClientProxiedBy: ZR2P278CA0010.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:50::14) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221002000617.469194-4-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|GV2P250MB0997:EE_ X-MS-Office365-Filtering-Correlation-Id: 62f425c4-9f1f-43e7-d44b-08daa40a09d8 X-MS-Exchange-SLBlob-MailProps: feAVlmA1hHWSfbl/QmJp6meF5MXcUmj/mzcuVaLy5MWBeJLnuklHGLNrEX4LLDc+QXt5JWriY5TF9RzMpbsc+qbUdkGP3P0BrV+Uk0EWcz9kJjs1wG0Y7aczmOwmXtLspDjl9p8PdPTtPAVM4FV1wGHKNr/J5qQ7YFw7x4CTZmg2HcTvRq4QxpFtLJR75SDM5FFtSouK0FG/7JYNS1RKYtMKzu9E6MK9rQkz7KXelyPi4t2vDvEvKnk5+MuVqHoFBm0tGtYaEl+T8/DFbbfoiYMwHJkQ63a1blsFYorroRzEQwUBCdRHMPRsXacmXHNDakf+uH2ftehPlbzFESJU2OzxAt74v2nI9qMurzGWzVwWlTob2Ayx0SQJvVGBEOzlrtUH1qzMFvDUqvrycDWJS6s1VwvStIqCJS+dLizm6YJI7EzowIzYA2V0UUs26a1qgHsa9Gcc3SUtQbBa2jcpmcpus0CDAnNjZJnBO5WECyxQQNEIUorubpGRDKa3Wd2XvZJ8W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ced2wU4oBBHloi2ImUtqVs38CVNaOPPW7EhgnvzKMA/MiYym6E5bFoV2a8D1s7ZCeMVgL9g7TslrtPG5eFBVROrscHv27PH6GEfWcrr99gcMH1zOwkcUwzqfLMkcbN6Y1VnDoO8RcPp/Ktfh3p0C888OZoYSFaJm7/T2MytgHFrqZYchFfXIrpuVa+mnimkQtq6rzIHyPvLuU4jJSH6at X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 62f425c4-9f1f-43e7-d44b-08daa40a09d8 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2022 00:07:05.0378 (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: GV2P250MB0997 Subject: [FFmpeg-devel] [PATCH 05/14] avcodec/huffyuvenc: Remove redundant call 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: o0G5NPqGm5at All codecs here have the FF_CODEC_CAP_INIT_CLEANUP set, so ff_huffyuv_common_end() will be called automatically in encode_end() on error. Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuvenc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index 80dcdbaa93..8867de0d44 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -392,7 +392,6 @@ static av_cold int encode_init(AVCodecContext *avctx) } if (ff_huffyuv_alloc_temp(s)) { - ff_huffyuv_common_end(s); return AVERROR(ENOMEM); } From patchwork Sun Oct 2 00:06:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38503 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp527382pzh; Sat, 1 Oct 2022 17:07:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ogs27qCnieKJqF2vcriJkSPUQDNRwhRTVzwO10JZLQcHs4YU8Sdc29TYB84890ITULLcn X-Received: by 2002:a17:907:c13:b0:781:d3c2:5015 with SMTP id ga19-20020a1709070c1300b00781d3c25015mr10752208ejc.457.1664669247829; Sat, 01 Oct 2022 17:07:27 -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 hv13-20020a17090760cd00b00782a3405722si4780688ejc.40.2022.10.01.17.07.27; Sat, 01 Oct 2022 17:07:27 -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="HinoK/T1"; 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 CD8B268BB3E; Sun, 2 Oct 2022 03:07:24 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2076.outbound.protection.outlook.com [40.92.89.76]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8F6D168B9C2 for ; Sun, 2 Oct 2022 03:07:22 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d7OnU9za5Em3XQhymFBemC6rLM7WwjUfn94p9CGgnE1J6jKBTeJpeKdFYFU0wm+ZqyUQog/So5RRF3EC3Cwr+S6d3jXOsmNDyKFQ4LwQ2221Rs3ew13j4e7gw+W/qhZvZE+Dpr4iJjZifYec690n9UG/Vp5SnpWhONIHmpLRYu6T9KnjEy9GOceq48eHgvqkl7jBwDhlU4eAYnHhEMXuRTUIYz2c+QEqJu5RZWE9jjP5VXdghgWrMdY3lRytIB3o3LNS586jQhc4ewzmw/6MUP+T0f6aokcjI8c9HJDX3eF9W5xCvM6O8Z/0gbe8AmJuDftthlluJmd4kHUn9tHHlg== 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=ZeaTrMFxQbzhaIHjZrnbjxqDxasNDrMVM0sHLh6bKnE=; b=QVy1ejoPHCcH749z1vhxXKSlh5EybDOM6woFpvCIjDzcJ6c3Qs63/4XIFLG8HvzHwNVs6HcsUzwnnXMzHIhgtLMvjwXgjwTseBxvcHFIMkw3B9fJoSp6Rr/w8+Ng1iPQTqxGuJYKTn0uc06c0mcGDcjIgEmfYJQZ10jRWBuvDn0KQTvHWf5oPNQl+RbEmToQANDEzgxgS58FlCHKu+dRdfV6oXoUfscen+c1Dyvhxt1F2TNRwQ5LSsd2GFpLElz8hQEPQZG8XAqtJRkp1o+tJDaecRKHZGKFnD5MnTxlodfeJNTizNMkaLWuPCLuxU/Ne2dcX7Iowvw0QgFBAl/UUw== 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=ZeaTrMFxQbzhaIHjZrnbjxqDxasNDrMVM0sHLh6bKnE=; b=HinoK/T1AIjeVimGumA8UG46uODS11rN8jgMv6JmnBg9JP3wMRUvgCe6gcVl147uk4fIkvoULAbOWCqH0R2P8TkY3xEszym2jeEdafl26JqVpRtMFeffO1fcvALgn8jFwwkEPz3P9UfY67HTN4VdqyxmrDic5Rsz4iTEhXPhKJ47aRshZnE52sLftKr4gQYtLpKuH0yxaIXKA2CwjIM8wYtR9SH24cK364ubLLsn1tomn1sK0/i6HrspfA2+nGMVUnqB1o6GQxXl53NO5oD7UzYI2QFPgI1D1XJocr8KDf02A9NrIkUlOitbXAPMFrZw+gLwhMmA+wBlqsjFZ2BxMA== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by GV2P250MB0997.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:d7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Sun, 2 Oct 2022 00:07:20 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5676.023; Sun, 2 Oct 2022 00:07:20 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Oct 2022 02:06:09 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [NHGGSJ0JcoHc70oDBgIQl5B7rCpoZ4W5kRgkHtI4InE=] X-ClientProxiedBy: ZR2P278CA0010.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:50::14) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221002000617.469194-5-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|GV2P250MB0997:EE_ X-MS-Office365-Filtering-Correlation-Id: bdab8d8a-bfa0-4158-9b41-08daa40a1348 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqRS+LhpAttTUY7UGhdHTSoTM6QdWA2eJhWC18f6pTnYoM4Gg8AveFM1EmUvkxljfe9SlJkIL9ZfWWLTKY3K8uBuqUfNaylX8RmGvowm6U61SxAA6/ACuASYyQF7WvBIBc0mywOt61KKdfp+qk+gc9hrYZ65v9dxlS2j6l2UPXJkyfV0a4R0c2XDOLiVrDcwuGT8ZYLFIdx4ja/aTnNcvfH73jR8XlaV0ecESGIu/xSwPMcXhE3eYXV4s1pJSa+RStXPSzTHUS160XvAa+6fgdeYLPretZJkfG1wpoLywhblNdeZ8hqWKeKOXGXAOej59cVmFshkqI5g66iL4s+3RgIL7PJbP9exbfTF+7Cr1GkwFjK/wUIokJpmvZAfkl9m2kENb3EblXJpTgobni6g8rNjS6OL+s9vOJRzkTaJwMuj5WOAPPWqEuyZnHGOd1RZ6OUEsaLNCmE4lM4bHPPsXNionf5dYtTNkVClD3vh+ggPYpB8YxuL43wxpVLlzeN7w9kCXhU5/A+te4+1LFnZHQO7yCc91y5Aawy5eraVMD/1t5v3gKC7o78UOUD0oK2ibz2to14CSMjrSZ/0+SyEjG620SK0pd7/um2GiXQ7qKA3NEZeRqkgcNQoKkYRnEoA6BU5XwMSOCD88qCUJfnkg0P1l+/+y/LiF2bSXpReFdSlLT+UKvoYJ+35ZYR2W9mnzShYwNA7QXViKhTO3ZxK/46fhRs5zNUFySQwPbfu0KP7W/lDmff562NP+JOjBryNt8= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ABdi3+GZ6bRxbH8eH5DAlPIdkl+IyHVsLPOL2bi7O83MNkMaxzFglo8m+czsdX2atrNMyC45C2sRoMCC7wkSrfwKDuDh0eP1HihfuqHu5dINYRdEAT/bsvEL0HIKkwlmHEPlnH93TEWNWiZteCM1Tum+Sgk9Mpc/qPW8SHgckNNtaF7pZdFdxTxVCJoVqbaNzzMscUytO7Gwp3xJSgBFCA+vH235sHvO9MfGAwak9I4grno1yHanDsf0bc/pem/KT3hwvsCQic+tHFTt0vIDSaFRpez0qfac6X8CnjuOfKIEy7AAOf0zw4k8ghXRZPzZUqpJNsGBdGSPR5p/RGakiE2tipxPovWtvmv5132sandnsMu7Tdo7a/DY0jbMPsYcnivWHRD6iJq6obGczcU2aPHArGDHTvUOwjnwEGKXF3ajLtz0LEvPMER4EqA3M2PWpYTQQYFGUjCCyOdMzRi/sjS5EEd0kh2slfd9TtwS2k/Jpk1TOTNAmOzp+pOJ4IcDeGfQ8x5LScOw/8ywS5zOQrikc26W57q48/Rq2I52hg/mKbFIi5+rIUf4T2q83fdFfy4/YJrvZRSyRFjZ4aGrSsw0AqaDM5tkgXvBsUZ9EpAvQi6LVc3LnM4l2HsrQmKdzpYLK/TSDC4iuqGV0rMFKQPlT39RyKiK0QEaJ2axOrJ03r2uZk8cg0r4IsMWzPlv X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SZ4iPsNi8E6uUdWxpUCk18YtYlR8mY9tV4FZbIz654sKk7XY9N4mVhVG96xkCKCYlHao2NSEV0HBqXg4x59zYa055IjGcqSPM5sYFQVecdn5TriRA/kcULWWTsCc0HUnF66U0EKpurM1wID+K3KQw0p9RutLShGG/mUW27Nwl7J96al6ymInGBBtWNU+3IMGZKV19K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dO4VBlwjNUGlgspgTipkV0vE7XAecbRezwbcQxzFKPDJHNBkRlbiV13+3czs7hXedMTEeXV2 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bdab8d8a-bfa0-4158-9b41-08daa40a1348 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2022 00:07:20.8686 (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: GV2P250MB0997 Subject: [FFmpeg-devel] [PATCH 06/14] avcodec/huffyuvenc: Don't second-guess error code 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: yXoedvPPO4AK Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuvenc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index 8867de0d44..84ab7f423a 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -391,9 +391,9 @@ static av_cold int encode_init(AVCodecContext *avctx) s->stats[i][j]= 0; } - if (ff_huffyuv_alloc_temp(s)) { - return AVERROR(ENOMEM); - } + ret = ff_huffyuv_alloc_temp(s); + if (ret < 0) + return ret; s->picture_number=0; From patchwork Sun Oct 2 00:06:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38504 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp527418pzh; Sat, 1 Oct 2022 17:07:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7A3r/XKSmQU7AsTSxEe8zUGLjba02XYtknhy26DTUh8SZZhZ82t4p49UQW1q+kC9StGhLM X-Received: by 2002:a17:907:9812:b0:781:bbff:1d20 with SMTP id ji18-20020a170907981200b00781bbff1d20mr10873143ejc.33.1664669258201; Sat, 01 Oct 2022 17:07:38 -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 mp31-20020a1709071b1f00b0073d64fca704si4537307ejc.36.2022.10.01.17.07.37; Sat, 01 Oct 2022 17:07:38 -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=UoVvdN0b; 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 E972768BB65; Sun, 2 Oct 2022 03:07:34 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-oln040092066093.outbound.protection.outlook.com [40.92.66.93]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 20C5468BABE for ; Sun, 2 Oct 2022 03:07:28 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nyMW1fq7g2hznAIzWkJq35eqCnL39UucHIjPeWZEpsUbzZNLpDNONmLGDkt5IYlQ/FgP9/UwQE7xitEVi6q4DKXthFKxm+7c5evwSJWtUEDrPixpbEVMo1BXfDAVpEq00zjykRCWElkxc2zKieiMtI3jSICVKvkjFruKLTG9bL4nEBnj7tVdkwPbnI2850rqk2+ZHwS/7vGPGhKnNhHIPiB+9B7kXjrBtxTEPs5FiueJUdbD4NzzphZbph4cTKx2egMXHL09xkbEmBBDCawzZLAqD9cj72osTnWE5rb7p9ycBSFJaOO6LPjPAm2GPcwlsQX5Jjtv/S/RDzsjKRc8mw== 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=sYKhh9ZcpZAcNbo8WwKQ3v4sOfaSwnXZkyOd552q9GM=; b=Ul4tJDCm9He7D0VkyhderdTjhv7EpH/odPH4aEJ45UcMgfftHlkkXSKoE/LuDy/r0FvaINXBGKM+FNVk67eJARSsi37T+O3KzNkr+IuXOEnyRHeZQT+a9oYi8D7EIbQaYCdxUGB2FW1Ka6bKxBgSul+MfkO+iTqIcj5pItuQxNpUSV15t7oeV1OPAHUY/FEML5Bt7yaCimWHkRmimYPKkp1T8Enr0SZ4R2cRBm6uc7GLtwyWbBLHiyi8AJsznujs6xY1mrOMvtdm5GlVMyrjODstXVod/eZE/7eTgYDZ1Bvsj7OsmpLzyCpCI8xUw+OHgBfksXuEEuLQe0200weohg== 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=sYKhh9ZcpZAcNbo8WwKQ3v4sOfaSwnXZkyOd552q9GM=; b=UoVvdN0bhKM1JNCTB3n2YfIswXZkynpEC1nFAzn611H8qUXNtCiZc5GL7/EQ5laEAVUbfO3ifkn1ktyVyUqQiF6Cd6gIstbR7urhCWXtJmrSUlP6juXu9COIayTsIoBIIm8X8DRQ9KFz4LMhZLoPKGjmFtlmkXo2zlQGF9KzyoFy04LF+2au7m8i0cYxFXbZbW3RvzF0t0emrbfs7NWGXXatRaWK+mQb/mqpF5R8UK6orNtYQ4tXlxKhREHA3DHBe4oQW3cyEEzDA/G7PkHpkCiecp09F5cPiNgigYTFyeEo09nbvWie0VGwKHtH301HyrrgiWiF7EtdkcxbTpw5YA== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by GV2P250MB0997.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:d7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Sun, 2 Oct 2022 00:07:26 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5676.023; Sun, 2 Oct 2022 00:07:26 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Oct 2022 02:06:10 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [csSBwQPCivwrYqibODumeetMGoiz0u5KwzzCJK6Kqc8=] X-ClientProxiedBy: ZR2P278CA0010.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:50::14) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221002000617.469194-6-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|GV2P250MB0997:EE_ X-MS-Office365-Filtering-Correlation-Id: 39e20d9e-807e-495f-79ab-08daa40a16bb X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqRS+LhpAttTUY7UGhdHTSobAHkFdROaaUXt1itC/3w13gQsgkRwOKLCr9XNisj/7gFjY6nxwsVn3S517+j+E34+VZBQEZmgF9DMGQsew377XVAEdpBRySYVIVCrHaGcKOGuEJAll1O0tAooBnzAcTvUxSC3VNO7MT7zsE0GPj31ydyxA4XdoYteGzX/uesK3EXZFDuToJMyEDvKIAaTGIHkoGC1qKdn6gNHQAtTlEojv1QioljBZuGfrTsrxjHXatUMXC1bBioTl6PUjat9BH0p4aO+udNmsTxcybZSZw7dIfFyTVQS2S7YWOeCi3qx2NFQY7vVv7mgEyA3BrqXNjHqebKqHc4D5mCT18IrS0yJjt4FKOFDOaU7IUqeMFrwSqhKZFgbyaP55it6yMSWy9fXl01sILQBE5kbjeysds3N4M8AA26aoSj4SGbdzIY0gPhq5ncVPTwJakSm+D2H+WaWLK/svRjXcqajArxzLglqCYHbiM+OX8Rr79ZjuuuDU0VKL1hSoHuEXO5Qylqgsxgl0mKFEGAk9Hb1kM3Nq5shu1DzCUcRnBQCl8eagfUFld5yAs4qAdmYEhsFPZCflpJql6fAp/QYFXikd4SnK5mNYWn98jYUKz/L5dehgaQyNuVnpZtsf0JbdKIocUbpWFkYfr4/TkX/zspzwY0WvxeBvihrKeC1/f2S28J6blrmG4+Sv1dcOCWw8vytwsUFuravo86PaRJj9bs7JRndkWOvrcr6TVgbF1eccc5vswpVrU= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3wDRQ6EmM3tg/EEE7fXrl1Z+ECw5sM7gqgukOm4xeVKrakp+KJj4bfeReJ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omuD2ZuAmCGbRt3OBMKnBSmZfEOv3PKuXjF/meNEpHRaz3yr4KjSSxwqSfJv0AiEh2vXC4x444DBpN8D4vdN0I4bYTbFb51a61PehZsMDj6kJgNuYl9ACm59uFFn2AJSfRiDlIa+AdtXYoSAbOJZTyrc/y5+89hIL0JRva/8Yw5rFrKzENZiNprzK5IjoF7KUC6SVsrpsKq8QVF7cgOT6eL713PXf7jeRlfSLIipVBQEtlnGjL7on/0dWlXB3xt/ZinMeW1jGx1gCZWEz+CV6iMxqOkIMnJJIegsjSvuJKHyZ1eKpFqMXpkHEFgNDzwXgggKEVDf2QjeBCR7HUXYKD9DzQL8/oHFUkQ+iElVtAve5eANpVPHRQhiehB+5eDqG2+2PFUvotqyTHDCiJmtD9Kwd+P9CtovA639w+d9f1V9OeISxxxHhKsWNldpZtbi6wGykg3xPB84b+mBmNxXEwv+oNLUSX9DnS8b5sSt0xApFeD0Dh7Hpx8X4hqjQKHU28/LOQbtiveSdvyjXr+ONctlz6RB8Lefj64MoI45Vhg2TsUb2aXEo6lWk3djSMI7f3va0imW9IKxK6Cr8BsLwFXPRks58R3HiOMe+BF291OrRPqJQJ71GCceEXF5lNwfR6aL0ZigYiSybmOoOnDeiuHI7VGWNr+V3LiXrcfVHLnMARVZyrT7nolRgLq6839pN6HM0iyOy9q110fqTmswn1L4/TIHDFhiBkOtErjUind8WimUOSj5DPXRZiybz/ZOnhFp+xdnj67HVJgtCfjVyJ+llvUh89joZ22g3zOUvMgBhShnVCq4+LdRKcCYI9OKDKD6ue00FWJPSLPWlAOQZft9WW/D+PyW2YpEhWgx7CUTqY7BIb94Zek7BeBcA8Zzq0s+I5cK4NKtB/fMQXa4OQjVUPHQNlGAcFFYO12W2jS7dnaiFwpUZtpS X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 39e20d9e-807e-495f-79ab-08daa40a16bb X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2022 00:07:26.6078 (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: GV2P250MB0997 Subject: [FFmpeg-devel] [PATCH 07/14] avcodec/huffyuvencdsp: Pass pix_fmt directly when initing dsp 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: T9ajQuh6mwWC It is the only thing that is actually used. Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuvenc.c | 2 +- libavcodec/huffyuvencdsp.c | 4 ++-- libavcodec/huffyuvencdsp.h | 6 +++--- libavcodec/x86/huffyuvencdsp_init.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index 84ab7f423a..2137a16714 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -210,7 +210,7 @@ static av_cold int encode_init(AVCodecContext *avctx) const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); ff_huffyuv_common_init(avctx); - ff_huffyuvencdsp_init(&s->hencdsp, avctx); + ff_huffyuvencdsp_init(&s->hencdsp, avctx->pix_fmt); ff_llvidencdsp_init(&s->llvidencdsp); avctx->extradata = av_mallocz(3*MAX_N + 4); diff --git a/libavcodec/huffyuvencdsp.c b/libavcodec/huffyuvencdsp.c index ea1ef911b0..36e8f6130b 100644 --- a/libavcodec/huffyuvencdsp.c +++ b/libavcodec/huffyuvencdsp.c @@ -68,12 +68,12 @@ static void sub_hfyu_median_pred_int16_c(uint16_t *dst, const uint16_t *src1, co *left_top = lt; } -av_cold void ff_huffyuvencdsp_init(HuffYUVEncDSPContext *c, AVCodecContext *avctx) +av_cold void ff_huffyuvencdsp_init(HuffYUVEncDSPContext *c, enum AVPixelFormat pix_fmt) { c->diff_int16 = diff_int16_c; c->sub_hfyu_median_pred_int16 = sub_hfyu_median_pred_int16_c; #if ARCH_X86 - ff_huffyuvencdsp_init_x86(c, avctx); + ff_huffyuvencdsp_init_x86(c, pix_fmt); #endif } diff --git a/libavcodec/huffyuvencdsp.h b/libavcodec/huffyuvencdsp.h index 603f9c8c2c..779a51ac79 100644 --- a/libavcodec/huffyuvencdsp.h +++ b/libavcodec/huffyuvencdsp.h @@ -21,7 +21,7 @@ #include -#include "avcodec.h" +#include "libavutil/pixfmt.h" typedef struct HuffYUVEncDSPContext { void (*diff_int16)(uint16_t *dst /* align 16 */, @@ -34,7 +34,7 @@ typedef struct HuffYUVEncDSPContext { int w, int *left, int *left_top); } HuffYUVEncDSPContext; -void ff_huffyuvencdsp_init(HuffYUVEncDSPContext *c, AVCodecContext *avctx); -void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, AVCodecContext *avctx); +void ff_huffyuvencdsp_init(HuffYUVEncDSPContext *c, enum AVPixelFormat pix_fmt); +void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, enum AVPixelFormat pix_fmt); #endif /* AVCODEC_HUFFYUVENCDSP_H */ diff --git a/libavcodec/x86/huffyuvencdsp_init.c b/libavcodec/x86/huffyuvencdsp_init.c index cc6dc5a560..c9c33b75b4 100644 --- a/libavcodec/x86/huffyuvencdsp_init.c +++ b/libavcodec/x86/huffyuvencdsp_init.c @@ -35,10 +35,10 @@ void ff_diff_int16_avx2(uint16_t *dst, const uint16_t *src1, const uint16_t *src void ff_sub_hfyu_median_pred_int16_mmxext(uint16_t *dst, const uint16_t *src1, const uint16_t *src2, unsigned mask, int w, int *left, int *left_top); -av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, AVCodecContext *avctx) +av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, enum AVPixelFormat pix_fmt) { av_unused int cpu_flags = av_get_cpu_flags(); - const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(avctx->pix_fmt); + const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt); if (EXTERNAL_MMXEXT(cpu_flags) && pix_desc && pix_desc->comp[0].depth<16) { c->sub_hfyu_median_pred_int16 = ff_sub_hfyu_median_pred_int16_mmxext; From patchwork Sun Oct 2 00:06:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38505 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp527464pzh; Sat, 1 Oct 2022 17:07:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7NJIXkPCQmupXufXgEoigA5AYMqNbMHiKNi8gUiS6rKQwqhYbE9bj+EMroOCfwb+tSGpFH X-Received: by 2002:a17:906:ee86:b0:741:89bc:27a1 with SMTP id wt6-20020a170906ee8600b0074189bc27a1mr11215460ejb.725.1664669267368; Sat, 01 Oct 2022 17:07:47 -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 j6-20020a05640211c600b0043e1c8af8c8si6210824edw.241.2022.10.01.17.07.47; Sat, 01 Oct 2022 17:07:47 -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=U8cUb9XV; 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 0773C68BB76; Sun, 2 Oct 2022 03:07:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-oln040092075064.outbound.protection.outlook.com [40.92.75.64]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D5EB668B9C2 for ; Sun, 2 Oct 2022 03:07:40 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X7vjQW7Pg1EwyIKtLheLNRa7TI2FudRhp/2og5WTFH820agc6A2vZvEXOqctbmePqPfSzKhV1usJpHmCJbpuehmJx8ysrnxUhmXfdg+RWM+fV5w9D06OQ/QQ5z6RcgGaq9nmO7xzCmJUsTFy9dNutVSU+yOa1Tw9bJEnpnGAXAkS4xEEX6Mbm+vZ3LqDfBY+qMJ5HvaaJ6WNWJZJJhKLmN95mcVsgHt0fxQMYlT0ZzxlgGTVBdrMuv/1YDvmKeHd5EDKP+SPKOFp9sAbYCb2jOt4DfpTx9eSegJSqV+XsZtel7ObqmHXzhioUuEvGlaEigsj+WPJz8mHXsJOIhRWsQ== 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=mHqq87Ekf5xkBESSYLD7maV5z90FlTnPwzb/Flb/HG8=; b=N2mx/zEhyOUwugQ7czDDlE1BbExIjnLkbCnlqCSYfGphfbHiuzDpJsFoJa0SIeoAUd7hhHuSA1l7X9sbHL03AX2o7eU501Mr8FAOwJqIhk8aCNxWixTkaKfeufVVzxjJTGF6Yssa101YdW/YinFW6suUwnnC8b4NH69LiTxG/MUNYER5dan10iq/vS1WC70FwwY7ymBpzOYWXXTzxw1E3IRm2emX//1qapP6iwm29Ozm6ThR4QplPUGPirBo0X33re9p9ZNAubRkd2A4zUFq2lJn8zwkrIxRTzdpbv/XYo4JUsIkAXlaYsq22c7Zbx7dXKIlI7U4k5cznVHlnB6JZw== 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=mHqq87Ekf5xkBESSYLD7maV5z90FlTnPwzb/Flb/HG8=; b=U8cUb9XVItSIfhS7wD9X01tMJ9XACT5fo7DSrrxxD0EQMKwMgFPipMKsYyOTfEQ97o6gbWcrPozkkG32RYMpUAIidupuNrYzTp3DNLsk0qWUaAtSt47CT5dOYu4ha/maFn/VlkLgKN4hYSdIuJJdZd+H9KXHUtnEhp6zoazE9I1r4FDb85pb49VLKBAGjWtlw668DZHn0Kg71ot1u++N/lwTmyEf9j85gaWcj6bHtTJsnSJfpDE45BxWQCh55i2cewt6wQbwwJA1v7WtBtqeA5M0MZ0xvnJqxP/HKokO8G7c42ujfsFMdRsVfPQOGwiDJPX+LIELzUgotOUdnSvhdA== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by GV2P250MB0997.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:d7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Sun, 2 Oct 2022 00:07:39 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5676.023; Sun, 2 Oct 2022 00:07:39 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Oct 2022 02:06:11 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [he/wAziQhpNVTrCGRDHjheBGJsbQ5e/veTHnu6omBsg=] X-ClientProxiedBy: ZR2P278CA0010.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:50::14) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221002000617.469194-7-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|GV2P250MB0997:EE_ X-MS-Office365-Filtering-Correlation-Id: 157d0369-6f4d-4aa0-2827-08daa40a1e2b X-MS-Exchange-SLBlob-MailProps: ZILSnhm0P3nPH8ePuXi+6dv+20UuINthQlaPYDRkZwPVZ/xklTQ5+wNjw9YoZg8YfLPw42ll2LmyOp6ApJJwNpPbYIidtqQDoxlTlUJWPXlGrYC8laQ0Km58t/CREaDd5TkBcC7ZAIJzMj09QZ3Tso6YgVOk8u5cQOBFKzaj+sqUARksOjcjVpnXdakAQk4I+jUcqREOCG4yPypAFRHE4vTiCSGPkgDtoCjEyrtqtLPt1VUUHIRMAOhm02LFBjFjr7nMU9PYOO4sYFPvLajx4VUZGZLIZ4N0LV077PBibNT1VuL8CqzfAPs5GBNG4lz7wDnmR00xY/wy6wc+MQ58db2x2UZDn2mX5XzNdSw9E879Qxpz3Kpw+4AALI166ByGcPrO0W7pwUO/njiaB4RvmMoyQMZLZZCRkThw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yRiivRoPphlsy1qNoQ0e/USD5F1JUPfkve94QFZ5ooYqxWyihapycIPB2599OHDahNX5hqG+o9HtaHbZSM2V6VT2COIOF/RE7QZZYABhFTG/5yhhiBAUT8i7AAv9yFB5eCPp2e02S8kJmUwfjkkff2uwosuC7bGCWcoy5oAnN4X/JrQdOV0+8HiqFywBzfCO062aqH8bhS8IGfSGSr9C65RRWqewwX0i3JgmCOQ3DpPANCFnwsuFDbSro/WvXyxMMr2jZjHZu1mTpox6a7yzRugY8RLRn5cmvV92xMbU+Kn77q4RUGPvXl+A4ib2vPHIjn0j/y1ji8tllVbIUzloozvvDH1w1DZ/Yt1O4XESp8= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 157d0369-6f4d-4aa0-2827-08daa40a1e2b X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2022 00:07:39.0837 (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: GV2P250MB0997 Subject: [FFmpeg-devel] [PATCH 08/14] avocdec/huffyuvdec: Don't use HYuvContext.avctx 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: N3R/JuTtSKBZ It is nearly unused anyway, so stop use the field altogether. This is in preparation for splitting HYuvContext into decoder and encoder contexts. Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuv.c | 1 - libavcodec/huffyuvdec.c | 18 +++++++++--------- libavcodec/huffyuvenc.c | 1 + 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c index e582060cc3..471bfa1bb9 100644 --- a/libavcodec/huffyuv.c +++ b/libavcodec/huffyuv.c @@ -72,7 +72,6 @@ av_cold void ff_huffyuv_common_init(AVCodecContext *avctx) { HYuvContext *s = avctx->priv_data; - s->avctx = avctx; s->flags = avctx->flags; ff_bswapdsp_init(&s->bdsp); diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c index fce7497386..edfc8c0038 100644 --- a/libavcodec/huffyuvdec.c +++ b/libavcodec/huffyuvdec.c @@ -813,12 +813,12 @@ static void decode_bgr_bitstream(HYuvContext *s, int count) } } -static void draw_slice(HYuvContext *s, AVFrame *frame, int y) +static void draw_slice(HYuvContext *s, AVCodecContext *avctx, AVFrame *frame, int y) { int h, cy, i; int offset[AV_NUM_DATA_POINTERS]; - if (!s->avctx->draw_horiz_band) + if (!avctx->draw_horiz_band) return; h = y - s->last_slice_end; @@ -836,7 +836,7 @@ static void draw_slice(HYuvContext *s, AVFrame *frame, int y) offset[i] = 0; emms_c(); - s->avctx->draw_horiz_band(s->avctx, frame, offset, y, 3, h); + avctx->draw_horiz_band(avctx, frame, offset, y, 3, h); s->last_slice_end = y + h; } @@ -952,7 +952,7 @@ static int decode_slice(AVCodecContext *avctx, AVFrame *p, int height, break; } } - draw_slice(s, p, height); + draw_slice(s, avctx, p, height); } else if (s->bitstream_bpp < 24) { int y, cy; int lefty, leftu, leftv; @@ -1006,7 +1006,7 @@ static int decode_slice(AVCodecContext *avctx, AVFrame *p, int height, break; } - draw_slice(s, p, y); + draw_slice(s, avctx, p, y); ydst = p->data[0] + p->linesize[0] * (y + y_offset); udst = p->data[1] + p->linesize[1] * (cy + y_offset); @@ -1029,7 +1029,7 @@ static int decode_slice(AVCodecContext *avctx, AVFrame *p, int height, } } } - draw_slice(s, p, height); + draw_slice(s, avctx, p, height); break; case MEDIAN: @@ -1100,7 +1100,7 @@ static int decode_slice(AVCodecContext *avctx, AVFrame *p, int height, if (y >= height) break; } - draw_slice(s, p, y); + draw_slice(s, avctx, p, y); decode_422_bitstream(s, width); @@ -1117,7 +1117,7 @@ static int decode_slice(AVCodecContext *avctx, AVFrame *p, int height, } } - draw_slice(s, p, height); + draw_slice(s, avctx, p, height); break; } } @@ -1163,7 +1163,7 @@ static int decode_slice(AVCodecContext *avctx, AVFrame *p, int height, } } // just 1 large slice as this is not possible in reverse order - draw_slice(s, p, height); + draw_slice(s, avctx, p, height); break; default: av_log(avctx, AV_LOG_ERROR, diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index 2137a16714..020159a20e 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -209,6 +209,7 @@ static av_cold int encode_init(AVCodecContext *avctx) int ret; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); + s->avctx = avctx; ff_huffyuv_common_init(avctx); ff_huffyuvencdsp_init(&s->hencdsp, avctx->pix_fmt); ff_llvidencdsp_init(&s->llvidencdsp); From patchwork Sun Oct 2 00:06:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38506 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp527534pzh; Sat, 1 Oct 2022 17:07:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7QEniI00+btG/dGFku6zXkNbLFgzICXUao+KZpvbN7OFuPqOutfs/cwHZmkFzo1bxKuoJj X-Received: by 2002:a17:907:2cc8:b0:77d:6f62:7661 with SMTP id hg8-20020a1709072cc800b0077d6f627661mr11124790ejc.233.1664669276688; Sat, 01 Oct 2022 17:07:56 -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 b17-20020a056402279100b00456f51ed614si5555264ede.361.2022.10.01.17.07.56; Sat, 01 Oct 2022 17:07:56 -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=KMCjltZJ; 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 DE3B868BB2C; Sun, 2 Oct 2022 03:07:48 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2102.outbound.protection.outlook.com [40.92.89.102]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AC2A568B9C2 for ; Sun, 2 Oct 2022 03:07:46 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ioTULmt+KiAe64xIrelqCRjN9tnz3E+K3alz66RNdiagghE40k+1bxAox21KEQ3cRe73d44RdSVmF3PLzFHpkMlcSJmpmyjksg1xizwlECUTP2VUMSycyP3o/xr2dPqr5A+efQF8gU7fDg1LChKs3sxE9kpyrz288tBQ4gWxFs/vvW3yDTipTiTSNDhoN/zk8lsCBXhZlCxOpJZVAvoBx6obJvaVlNa1OS9qtjPxRNCWXxWoXyc899+qxP5728HR2b3ENRF1JAlrD0yzYlUEEmUcoGYdLoN4s8S7LPe1kQHWbKFkS9256JzpGxLFu9W2t6rN4xnoyjGmVRdkrXNWSw== 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=ReYEpHnwM0/QM9Yyf4VY8EcREuVWyWkFWwtccEYRzDk=; b=ZfBchlNVX/LsLZD34v4i/u3TT9C21WbuTBgr4QCULuxAeinN+EXcAfTQd1+9s1qkknjFe2HiJgL7GPHo11CBRZYdeQUBxLH6oRiC2zHaPC0FkaIzxcKg/FNt/hCSecRW28mHIFw/desGjRYXDSV0jNTpJg3PTcpc5d/9F9Qhi2pua4ir+bB079svp9RSVpvzSDTMXFCR6mYIdZEqTrw16OiDR22tvinlCZR8CaoLqhDlIIObhsgTArhOANtyVVx0G9Rngt/Rl0UVyAw9prczcy6lQshQfvOBxPgHnv8cBk4ilid4t7pV3K5JEdw/vsQ1OIQ6czwPjRUyEa5Bl3b1ig== 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=ReYEpHnwM0/QM9Yyf4VY8EcREuVWyWkFWwtccEYRzDk=; b=KMCjltZJc/05Fn19hTYsvX/hRPMWxSvy2a+LpVMHI+TU+djxxiXtLStft8Cs3wesGuMkgevl4YdD2IzeHelRfFQJa01E7WO6kYwPJdU0kFmMwx59oHjohl+8YdbHAHkL2i32lpCkGL2sx6yI2h3okADh6zwy6i+zDoOoI96qDZxe5cT1/tXpa0FDaiCFlriJ/gtFJzkLNjlHV9b0sLVX2i/wDBWZuAyKpzXWDsLKQQmtNpjUYFSFbEC48J0ObLTOFYSzE+wqVen4JFU2Jz+c5CwEQ7KkH+tNWTSVfpDNAJVO2PEj69XCoMTIePL7Q3JQM0dcPWE5Q6mwe18C2yxnvw== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by GV2P250MB0997.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:d7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Sun, 2 Oct 2022 00:07:44 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5676.023; Sun, 2 Oct 2022 00:07:44 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Oct 2022 02:06:12 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [+YPXZOst53/Zo2Z274y/NH+tvJ1iLW3xLLzxc/hAESM=] X-ClientProxiedBy: ZR2P278CA0010.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:50::14) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221002000617.469194-8-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|GV2P250MB0997:EE_ X-MS-Office365-Filtering-Correlation-Id: 449ce38d-bea6-4d61-f01e-08daa40a219f X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKx7KypBKN6CnruNpK5hV6MtspfGoFFjgFiXHHdGFHZqKqglZriVcgZpURQFgK/69GyObqu5buFwNoQWZEyFx4EWGHmR849EDHXlQAUXFMC54NtoFGyuPoeuuVzJVibKRJ9qWHc6zNNCspA6Ks33W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sDYNMdGLUiCtKAZvz9PWJrqLhfv9S0Tq9m5prWo879QxmkdE6MaAVl5bS2TC1+3IIg+XsKyvxToLsKc8g5nyBqN/FZUtsd0+BEgHRqIu9HfkKR28z4FZsFdWEO7XyQhLvxHwJBuuP395Yl/W8FuhFNJV4S7iMzENbqwznHr6LegDSw+iFeXVNzizzVCfKRZQbvXHntqbtX6PP3JEHXkObcRVcikC/Vfjz+lkQwSwGpD7RpijtNUIrSnIXrtXF1YWM+XZg35+g/lWJnibAoxx88fcrtC08Gai9GBlUky808J4Omfa9aA1U+ZuorTvpkHq9q4jeIZRFk0JwU9k/g+AcKofGj77XG8AdlpTJf9u4v+AEvAfjhoso3dI+JoLqWgepKydtenOoF2zXyIdMyhAUHQY8SkC+ccWlRCpjfJHzxm5ylWHrkAPT75gNvk58OAfY9C1wyJmPmEijz7M0xt+6ERAEJO6GD6THA2hUn5jZNRj6XvNyN9jiglr4zL1wjIg//AqT/sX8+pdMDNaYJgUn2/k91UXvZJfOKY9G+a8CDIi/ctxRzqv95wVN5PJw= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 449ce38d-bea6-4d61-f01e-08daa40a219f X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2022 00:07:44.8666 (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: GV2P250MB0997 Subject: [FFmpeg-devel] [PATCH 09/14] avcodec/huffyuvenc: Improve code locality 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: +unrMZBp6sZS Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuvenc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index 020159a20e..f903b1924a 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -207,7 +207,7 @@ static av_cold int encode_init(AVCodecContext *avctx) HYuvContext *s = avctx->priv_data; int i, j; int ret; - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); + const AVPixFmtDescriptor *desc; s->avctx = avctx; ff_huffyuv_common_init(avctx); @@ -215,6 +215,8 @@ static av_cold int encode_init(AVCodecContext *avctx) ff_llvidencdsp_init(&s->llvidencdsp); avctx->extradata = av_mallocz(3*MAX_N + 4); + if (!avctx->extradata) + return AVERROR(ENOMEM); if (s->flags&AV_CODEC_FLAG_PASS1) { #define STATS_OUT_SIZE 21*MAX_N*3 + 4 avctx->stats_out = av_mallocz(STATS_OUT_SIZE); // 21*256*3(%llu ) + 3(\n) + 1(0) = 16132 @@ -223,9 +225,7 @@ static av_cold int encode_init(AVCodecContext *avctx) } s->version = 2; - if (!avctx->extradata) - return AVERROR(ENOMEM); - + desc = av_pix_fmt_desc_get(avctx->pix_fmt); s->bps = desc->comp[0].depth; s->yuv = !(desc->flags & AV_PIX_FMT_FLAG_RGB) && desc->nb_components >= 2; s->chroma = desc->nb_components > 2; From patchwork Sun Oct 2 00:06:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38507 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp527565pzh; Sat, 1 Oct 2022 17:08:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6CRvc4WGWmPebJJg/0Xdc7GhlpQVxt2juKs2tnWRpWnvulLfZwhfjyVaB1vKPOrvl/cxgi X-Received: by 2002:a05:6402:380a:b0:451:ae08:7a6c with SMTP id es10-20020a056402380a00b00451ae087a6cmr12679633edb.161.1664669285234; Sat, 01 Oct 2022 17:08:05 -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 s4-20020a17090699c400b007894b9de062si2820380ejn.631.2022.10.01.17.08.04; Sat, 01 Oct 2022 17:08:05 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b="S1/gQjzF"; 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 06D7B68BB36; Sun, 2 Oct 2022 03:07:50 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2072.outbound.protection.outlook.com [40.92.89.72]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 794EF68BB36 for ; Sun, 2 Oct 2022 03:07:48 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GZvRERBzwz3Ho4kshNKKGfgcD6eQNBc5kV4TBClcUWM7yX8oOhIy4TOyzV4E+R4Oc0GZ9n5xeR+U6e6AavkWoJ/0nHwcNNx3nQRcFcSey0R0ZgkdCdfA48ZiGaeHdQ05PxzluagvkzjHqtY3bQys2k1rRWPyBpVYcWJlpbe/87diOrnvxX+nOdzPELntXUGeUNlb+WEdlffIlmwjX1YQEBbVQTzBf4HcLvOkuVrVyJ/6ycdthe+TsXTnCt1IhgHJHJOKeXyFRGCdCUc2r7pKlPVML8UDyaJqntVxKgOsgj7Imq13Pc7m6SgPdk7keiBApa4X0NhhguSDgPEiZvuQpQ== 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=PVT+HKEHk2Qzx5I4N1eiUzUzWXuGXFLh9GzQK2jAkAU=; b=gRS/GIrxsElVsPx0rWqBkLXyBgUrJDJtaJ0L8Btz/DGDQ+yCUvLt6QTRx4Oj+6GlwID5+s+svfjZb0mEGWrOEkpVRMBLTX1BTjzLfHUUqw9ot4aYc6dPoF2u/ykUbkUeZmGV2pALi4P7Rcxi2voJ1ec6/MvfX2O1CmpxRfqMN9bsDttp/9oLI7F0Dcb/STJO8PssY/Nu5W5u2RKscNSqydgV1s4567dvrZ1dsE4B16bcLIlcc33ranFZJbCcLBzF08py9n08iQ5CereRCUMAC9CWtDrVVvn6G5khYSYu3p/jATU+SiG6fpc+fBBCeASxiRVC7WxlpbJxIvkwaYVTHQ== 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=PVT+HKEHk2Qzx5I4N1eiUzUzWXuGXFLh9GzQK2jAkAU=; b=S1/gQjzFscJVYDMmCoEHIc9vq2UOwUKii87aDiV1vk9PPSp2bfKn7t6DfMs5a5nI+kuMYxxEwHtEAhlv8AF1pfkPZYGMXlqaWqIM2UucGXkbLe1Bd1msEwRgoiAqSTrOZHYah509opXvjxIXYxMVBhjpoSLh2ziTY8ty6r4xe2dV/ChKKfDJF+D4Q+90AnQf7JhItIoqsMOfutiGJDDDxKXi6FtmhhMLvQu6MTY0/vB1WBusQI+4ufkFd+Ni4ju5lI08MV6Ta7vQPVQolVFpo/53+5+vGqgptqpwV5tZ+gXUsCEEIV+WAHurWs0Ac14jv6Avnj7jTQ3ImlhNR8VMhg== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by GV2P250MB0997.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:d7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Sun, 2 Oct 2022 00:07:46 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5676.023; Sun, 2 Oct 2022 00:07:46 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Oct 2022 02:06:13 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [dqoYQO5i4zoBl3yO5ocbSajdEtFNNXAb8BBAKBgDgPQ=] X-ClientProxiedBy: ZR2P278CA0010.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:50::14) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221002000617.469194-9-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|GV2P250MB0997:EE_ X-MS-Office365-Filtering-Correlation-Id: 339a0a63-ca00-471b-908b-08daa40a22c0 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqRS+LhpAttTUY7UGhdHTSoiyuqOlDt6RssoduzP17zCWsiWXCbV9wWNralHVCjF+510PdGus82kQeD8O4//le9PzktrWMxv6fnybBWbXYAzzEWmdlA0VYvfYWcKAnJjG9TLd6KQ7ht02Depv3Q1aiFBSJ/mZ7PElT30jvu0xiVRhgA9R1GxRAz5CMYJnu0fjx/Bo7OmmH5HxhoUU4AJrKtsJIPlALvpQJMlgrdPYoWWxjYNVF4H95sMDjCl8t9p6eq5YMxTgV9ki91fclXeXhbOChuzfgVjhxvypMkOAMXzk0s39N3oNjTTeIxfuMUy1gso8hMiN8mpL7DklLC3PdUqYr66DVP+aj3MJFswa8j49qm/KZqO+wWGhI+tlQeHlMadXnTXoYOK76UFRtFCxiSURj+FU5qtxjIcz2nubVZ2iXadNuvdS+eU+5Bn0mpLU6okTlD8fc/HBrLba5ILWzayIjE/4d0nWpngol2QzDR6AZPY2Cr9LUueFBeAjjyozrfWmkAagh8saJIkPbcXSWnev384MYuEHZTEu0ytCIWsYuXLY6t/df7fGMVMrRIKJIz1/bxUs7zB0/2GAyzJwPeBIwRufvFzm/fYitXVxSOVrK9b3e4cMKjRyduyTpG2dPJGfD0m3V2LFX3tStuCgzEc/Sz72CPRnXNupWzwvUibooez+oTeko2pFrM0D4MD2f2YfzCm4s9y4heRMrvpSQItDUri7Ehw40IOGOBKRiFOI9KCjYqvKojY9zOsqpC2vA= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WR4CqBg67z3xMUNkDSB9/lM3YvSkS2vOLLm7dbINUy9wfNvV6ddFxElFuTVBKbaV8qHmLM4Jj+fB8LOKmrSuoZBjH6dhp9cndWCk2sp+sSrD8dSnEyoUJBR6is2Jw80xdavvlvMeJ4EiRPG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LPjCJIFTLHC+ZVORcMEwdca5UZ6z3ua8v7fxOTqPNhI1mp6BvBxeG4Ln67miqJZpimR2tvARCcWfy4GERjiZsT7npuhCl1HVHv9pZQBkXAbV8xo6ZMd5B9pga8UKtwJ3r8+tJnCc+KkHiw7S1UW13MFzqtHLt5Z4FgMr1DgSAVn2zIKYgR/qE8p/FoblVX9QSDQD5GTO8fVsVsgk33MHkgLJ/lMEKgEPCXN0ApFII0NCNHKtpb9i1Z+ey2fPnXkIwCHqAm1S1MMOBr2Tx1aYja/vMGjfuLw9Br8t8jJhIAmMbr6ceen3sFGXPJy+CK77bzSFYTD7pTPDA9ps1CvxYypOsPzOKnKZV/nkAhtbPaOygB/AK+DDAHibzmTLbu3uXwgbH77dWJhoAPiseKF/2VAXy1U+tFSVBIpIsJO67rsqf42unWDIcU1x8W7D7/wHiXOhDmhZbNz+n8C/JyMTiP5ZNDNS+VLFoRBKDjNF/9sHjoZe75Clm69AcDibNTSZTXfJhcZelny9fuiUY33UaGa7caWRbsMwccfZWm4cxQFIcFIvP9Cy9SsUIve4MANyYzkNvoTkTLhU2z+nZKFBtx3OU8a50vD9OhjmNX4sw+MiOg8Ft2Msuio8LaR9D7Iow7VsaEDQ6F+sFvWVBCJrgsxuKq+KxEthMPqOrUpDL2+Vw2h8/ra7uN0uJBHZrZoRsIUgSXxHxTVIfi8DaqEzdQVum8nuxt/ixSc87bUtkvPoi1OxRar1aEntzUoyGC1VNmj5uiCH5LdtpifK4zqjPqL8BuxaBX0JXH6RBDbtQ8HuDr5/pZS5TshomFUQZjpsNuaXELcLRv85zVMn94kSmQSrFxadA7Ed9leM= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 339a0a63-ca00-471b-908b-08daa40a22c0 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2022 00:07:46.8363 (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: GV2P250MB0997 Subject: [FFmpeg-devel] [PATCH 10/14] avcodec/huffyuvenc: Avoid unnecessary function call 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: J8rRH7CeIGJz av_pix_fmt_get_chroma_sub_sample() is superfluous if one already has an AVPixFmtDescriptor. Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuvenc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index f903b1924a..9da344a666 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -230,9 +230,8 @@ static av_cold int encode_init(AVCodecContext *avctx) s->yuv = !(desc->flags & AV_PIX_FMT_FLAG_RGB) && desc->nb_components >= 2; s->chroma = desc->nb_components > 2; s->alpha = !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA); - av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, - &s->chroma_h_shift, - &s->chroma_v_shift); + s->chroma_h_shift = desc->log2_chroma_w; + s->chroma_v_shift = desc->log2_chroma_h; switch (avctx->pix_fmt) { case AV_PIX_FMT_YUV420P: From patchwork Sun Oct 2 00:06:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38508 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp527658pzh; Sat, 1 Oct 2022 17:08:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4mg+1LSko/56Mt/OyYj31iP++f9zK9BQJ6jfZc3Sr7AedgX0D6w0pJFdxKXTfjShyuhDK5 X-Received: by 2002:a05:6402:2141:b0:456:d714:17b6 with SMTP id bq1-20020a056402214100b00456d71417b6mr13360812edb.425.1664669303054; Sat, 01 Oct 2022 17:08:23 -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 sa23-20020a1709076d1700b007825af06b0dsi5238204ejc.696.2022.10.01.17.08.22; Sat, 01 Oct 2022 17:08:23 -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="SNxiWy/S"; 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 F16F068BB6E; Sun, 2 Oct 2022 03:08:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-oln040092075088.outbound.protection.outlook.com [40.92.75.88]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EF88C68BB3E for ; Sun, 2 Oct 2022 03:08:17 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YTQ/OYkA9oMLowDbb/NA1v5r/0/+eF1ccePDghyKv8qiDMMAOUdye+JOBrc5HuVzKFDCKl/KwMs4pQ8IHt7Mx+t6ZqSjz68Es7Qfd40V8a6F8DVT1pWj2qW/R2ZYaPppANgPxPG/CJFnLSGvyo1WrrqD/Ng6Iox4h0w9O+lkW1vye3MME8tkPGUnJApyO11ytRUwjCfaDNf7Zc4MrLgVAZowx/xLDk7/QoIEdAsjn1fxE9/Kp/ki9DUZGDaSXhppeFENvmHRiWzBr+pZ2rQm8t7IRgCDwTBPk5iEWH1vBcaeBnBvZ3b9OzINB2LF5N0f0HeBahknHAlb+JnRspRjhw== 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=Ukq9elZQ4CxiDzNwIC3ue/c3qg4yV9AhFuOhz9vKoRU=; b=FQ24juMHNro9MW+WXsFKY8v1uMeIaKkT3Ih8XJhGRF9IlrzLjKJ4uboIDn4jjJiaNn9ISYKSxUM988Co3Zdw57usDvslvdA6wwClIEog109QXLHEH57clD0WE2jaHKs1RT9xrgh+8jHKLKIzix2mQGFjtzTjQO+oGlotM0bWyHgeFHTTuLG37rJkLQO0Fp2mhglQ6XqwTba/W5Fdzemz/xsykqdRZyGwXpUVFWvMnSfEkgsYQXb3cY2UoR0qh0LLs+mpyd3ChD7LTYc7dHACzPYfqxahaIhvwQQi1bpLgmss5PZnT0n4dFqAPKa3bOoq7r2bJ9XBOYEAcHCE2otS+w== 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=Ukq9elZQ4CxiDzNwIC3ue/c3qg4yV9AhFuOhz9vKoRU=; b=SNxiWy/SWDU+vWVGFR6b63BZtlRFmBbyTskJ3kCIMaAyIa2dDX2gFCZOjKSP6iLCd1UhMWUToydvQalMd5GvnT34qlvbmahFeUNH0W7RB7F2p1zeEo2uzrf59F8E0SCHKjFTEs4QvcBvfsyzi1m3bdGfIK/ZBplNW1L7gMAVQxA65YBROLLVDWGn2TM61g88Q2lLwgib1fmrWhCuf5PTdLo4yJYXL5ODHdGnA4jYWL1Pju58+6WyICsgfFmp+OqtneQuIc14kLSexhaSoEnOOHEBW22L8HedKfrdbQtQvbBZZkX7rSL6ZgDwW/aAhtY6IYbJJYLtqfhDdQnqppA9Lw== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by GV2P250MB0997.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:d7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Sun, 2 Oct 2022 00:08:16 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5676.023; Sun, 2 Oct 2022 00:08:16 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Oct 2022 02:06:14 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [oXxYmDR8TfpWnRijELGaomiQdCrJ7fBrr24S3CCdkA4=] X-ClientProxiedBy: ZR2P278CA0010.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:50::14) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221002000617.469194-10-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|GV2P250MB0997:EE_ X-MS-Office365-Filtering-Correlation-Id: fa7ff31f-b481-4752-fdec-08daa40a3474 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqRS+LhpAttTUY7UGhdHTSo/Fa29JLsawWKDDDtDsV2cqLbcbEuycCr7XiXBLiV/8XM6As4zHwc+yymyTe9K3GHCBJNq8XodOtyUiuMIB1iNSb8++tjlbeqjfiblQ1ZNNGQ8aIs6qjYf5uDU57/Pod339FqM27IMTKEy6IbazypvU+An0sVtg0CHaai/LM5XxoRAVzfV9tL8G7H5Pc3bznIJZj8+sRKmfs12JgZJSlse0/leZKehWEys64GBNet+3V2DjZWChPoS6ZHZDad37fbFykLfQ14IthCSZVt+ekHRlc5P+y/biE6vPZq8FqVUExyQCMuMIi6pMrWUoWQnW2/k9+0x+/Hqgrwk6yfIbhtX2zXPTSNfsZJWqXT2qsv2wN/7st19I7IZbWVVANiUD3MA1x1FwZ2sL1lk3gEWAaFaHBv4cedjtkk5gf5HKVTFx3n/z+wIiqQkv5NmpaYbdFmUE+nyAARc2bBcPY7FrHxHJRpPks7xDN1JfJc4AKIFs7gb3mkucJFfwxDrO0QQ9ojWT+AaJyxmAa/C+Poc3+mTSwTeKdyVleGudazStXml1ctll/O2sLUORJV0vmyCjlSCFKwHXyxHssnpubBXYyqjZdluvSXM/j7rzd6umC8ri3PSQUI8aijHGFHsuirgMZXZ3ehxD6nLQww/jk+kNL6y2BVCFTOilArRRBRK81KyV7GLojUcksmWdKaZ45sTCIP5V//F46J3x513z28m2qTidm0VuMzw6EKmh5do2UO41A= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d08kwBw0h6IdLO1WZoHuVs+h6hcNS6ElresVjwTrsMyZ5s/kDD1gAnTQ1PHekwCmNZ/jO/omx8amaLYZ3RMUUDoLbdsTnaL2hPQXmk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mvv9GRHpAQzBlfkZLgBeZc1iDAAdNKm+MqeGtlkH6FD77BMl1jxrW+x4+5Ae+k0x+hhb5CrzwgsF+MMdN9D8WygTmAQjzWSPGl3DlsdZouZmpvIajzDkwbq9UDpnuuxMrP58eljhER7jn6TnI7LJRC/Dg3EWl7b+ox0MLqkPFwLyif9LSOB0wHliTOv/EUzGEd7vO7q9nZb17Pyh2azXblRAFKHlLcpRafVzvh2APYs7RnFXqYpEBmBrvAURAAiVpwZiJLcrsVaqqPuM5P/OVYF6dLSIk+HBjdGuPuoWmT/NQB+t0BkbwXefIwkN0IB54DzIOTC+1ogBC/+N66ZunEjpbyJdGq9WkESqfFOs9nBAKWQGP6V5BjaoiaXRr18JMKJmyb4juwk7IwzdCPc3KbWbblsrSfr3fRAOcCL9Vl/uLFPgzBTEDEJ9lzielEBBq1B4vCTShBeGDvMpEFWArhk0/SacxxIBoyOpFWVxUyHnCcbx5MnB8bS/rc4xDCfRZRl6pmPgvFqdmDH6l17MrAtU1jtVXGLkGupZUQhA9X5NeOu/ANCvpqgryWg1HD+V01TZT7+kv+n0xAPLP0Q8451KcZuGecovC2YJYbCkX2k63MVm3czG1vMF36Dp7Q14ICCjIzmeq1RIAV1AlpVoXV7FYm4tPcVrk2s9ATp+kf/sSph/H7zN0Vv94K2VQe6voNI1coKzhsrbtEjTKxV5aZYoc2JKU2kAbifEBjbvBuMgEKnPee7Mpdg1bZRapB7klE43uEMtLj1FzLPhHafpfAjv2MTdWfj6aEIZyxyOzYC9n8CyUpxppyIvdmovVcB9hqeJczn3AmHXr2YoF5xsu9sDgDxFQBZb1LnRL7au4dRnIocMqd5WWqpq46Ra5DQ9PokdFFaH4W03I= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fa7ff31f-b481-4752-fdec-08daa40a3474 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2022 00:08:16.4932 (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: GV2P250MB0997 Subject: [FFmpeg-devel] [PATCH 11/14] avcodec/huffyuv: Use AVCodecContext.(width|height) directly 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: sQRDl9Kh/7y2 These parameters are easily accessible whereever they are accessed, so using copies from HYuvContext is unnecessary. Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuv.c | 9 ++------- libavcodec/huffyuv.h | 3 +-- libavcodec/huffyuvdec.c | 10 +++++----- libavcodec/huffyuvenc.c | 20 +++++++++----------- 4 files changed, 17 insertions(+), 25 deletions(-) diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c index 471bfa1bb9..4a5bd53998 100644 --- a/libavcodec/huffyuv.c +++ b/libavcodec/huffyuv.c @@ -55,12 +55,12 @@ int ff_huffyuv_generate_bits_table(uint32_t *dst, const uint8_t *len_table, int return 0; } -av_cold int ff_huffyuv_alloc_temp(HYuvContext *s) +av_cold int ff_huffyuv_alloc_temp(HYuvContext *s, int width) { int i; for (i=0; i<3; i++) { - s->temp[i]= av_malloc(4*s->width + 16); + s->temp[i] = av_malloc(4 * width + 16); if (!s->temp[i]) return AVERROR(ENOMEM); s->temp16[i] = (uint16_t*)s->temp[i]; @@ -75,11 +75,6 @@ av_cold void ff_huffyuv_common_init(AVCodecContext *avctx) s->flags = avctx->flags; ff_bswapdsp_init(&s->bdsp); - - s->width = avctx->width; - s->height = avctx->height; - - av_assert1(s->width > 0 && s->height > 0); } av_cold void ff_huffyuv_common_end(HYuvContext *s) diff --git a/libavcodec/huffyuv.h b/libavcodec/huffyuv.h index 83309d4b11..92e390ad78 100644 --- a/libavcodec/huffyuv.h +++ b/libavcodec/huffyuv.h @@ -72,7 +72,6 @@ typedef struct HYuvContext { int yuv; int chroma_h_shift; int chroma_v_shift; - int width, height; int flags; int context; int picture_number; @@ -96,7 +95,7 @@ typedef struct HYuvContext { void ff_huffyuv_common_init(AVCodecContext *s); void ff_huffyuv_common_end(HYuvContext *s); -int ff_huffyuv_alloc_temp(HYuvContext *s); +int ff_huffyuv_alloc_temp(HYuvContext *s, int width); int ff_huffyuv_generate_bits_table(uint32_t *dst, const uint8_t *len_table, int n); #endif /* AVCODEC_HUFFYUV_H */ diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c index edfc8c0038..89db3db65a 100644 --- a/libavcodec/huffyuvdec.c +++ b/libavcodec/huffyuvdec.c @@ -558,7 +558,7 @@ static av_cold int decode_init(AVCodecContext *avctx) return AVERROR_INVALIDDATA; } - if ((ret = ff_huffyuv_alloc_temp(s)) < 0) + if ((ret = ff_huffyuv_alloc_temp(s, avctx->width)) < 0) return ret; return 0; @@ -873,8 +873,8 @@ static int decode_slice(AVCodecContext *avctx, AVFrame *p, int height, { HYuvContext *s = avctx->priv_data; int fake_ystride, fake_ustride, fake_vstride; - const int width = s->width; - const int width2 = s->width >> 1; + const int width = avctx->width; + const int width2 = avctx->width >> 1; int ret; if ((ret = init_get_bits8(&s->gb, s->bitstream_buffer + table_size, buf_size - table_size)) < 0) @@ -1185,8 +1185,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p, const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; HYuvContext *s = avctx->priv_data; - const int width = s->width; - const int height = s->height; + const int width = avctx->width; + const int height = avctx->height; int slice, table_size = 0, ret, nb_slices; unsigned slices_info_offset; int slice_height; diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index 9da344a666..0e9b24c8db 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -236,7 +236,7 @@ static av_cold int encode_init(AVCodecContext *avctx) switch (avctx->pix_fmt) { case AV_PIX_FMT_YUV420P: case AV_PIX_FMT_YUV422P: - if (s->width & 1) { + if (avctx->width & 1) { av_log(avctx, AV_LOG_ERROR, "Width must be even for this colorspace.\n"); return AVERROR(EINVAL); } @@ -310,7 +310,7 @@ static av_cold int encode_init(AVCodecContext *avctx) } if (avctx->codec->id == AV_CODEC_ID_HUFFYUV) { - if (s->interlaced != ( s->height > 288 )) + if (s->interlaced != ( avctx->height > 288 )) av_log(avctx, AV_LOG_INFO, "using huffyuv 2.2.0 or newer interlacing flag\n"); } @@ -379,7 +379,7 @@ static av_cold int encode_init(AVCodecContext *avctx) if (s->context) { for (i = 0; i < 4; i++) { - int pels = s->width * s->height / (i ? 40 : 10); + int pels = avctx->width * avctx->height / (i ? 40 : 10); for (j = 0; j < s->vlc_n; j++) { int d = FFMIN(j, s->vlc_n - j); s->stats[i][j] = pels/(d*d + 1); @@ -391,7 +391,7 @@ static av_cold int encode_init(AVCodecContext *avctx) s->stats[i][j]= 0; } - ret = ff_huffyuv_alloc_temp(s); + ret = ff_huffyuv_alloc_temp(s, avctx->width); if (ret < 0) return ret; @@ -715,9 +715,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet) { HYuvContext *s = avctx->priv_data; - const int width = s->width; - const int width2 = s->width>>1; - const int height = s->height; + const int width = avctx->width; + const int width2 = avctx->width >> 1; + const int height = avctx->height; const int fake_ystride = s->interlaced ? pict->linesize[0]*2 : pict->linesize[0]; const int fake_ustride = s->interlaced ? pict->linesize[1]*2 : pict->linesize[1]; const int fake_vstride = s->interlaced ? pict->linesize[2]*2 : pict->linesize[2]; @@ -848,7 +848,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const uint8_t *data = p->data[0] + (height - 1) * p->linesize[0]; const int stride = -p->linesize[0]; const int fake_stride = -fake_ystride; - int y; int leftr, leftg, leftb, lefta; put_bits(&s->pb, 8, lefta = data[A]); @@ -860,7 +859,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, &leftr, &leftg, &leftb, &lefta); encode_bgra_bitstream(s, width - 1, 4); - for (y = 1; y < s->height; y++) { + for (int y = 1; y < height; y++) { const uint8_t *dst = data + y*stride; if (s->predictor == PLANE && s->interlaced < y) { s->llvidencdsp.diff_bytes(s->temp[1], dst, dst - fake_stride, width * 4); @@ -876,7 +875,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const uint8_t *data = p->data[0] + (height - 1) * p->linesize[0]; const int stride = -p->linesize[0]; const int fake_stride = -fake_ystride; - int y; int leftr, leftg, leftb; put_bits(&s->pb, 8, leftr = data[0]); @@ -888,7 +886,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, &leftr, &leftg, &leftb); encode_bgra_bitstream(s, width-1, 3); - for (y = 1; y < s->height; y++) { + for (int y = 1; y < height; y++) { const uint8_t *dst = data + y * stride; if (s->predictor == PLANE && s->interlaced < y) { s->llvidencdsp.diff_bytes(s->temp[1], dst, dst - fake_stride, From patchwork Sun Oct 2 00:06:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38509 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp527713pzh; Sat, 1 Oct 2022 17:08:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM53SSx4xiS3l7s9nDDtDrZu4s3yBNjdj3KJbzCvAk+Jc6Mv+I6JoVy0vQ1Aa6tjVpWTsmtc X-Received: by 2002:a05:6402:26d4:b0:451:280d:3533 with SMTP id x20-20020a05640226d400b00451280d3533mr12885933edd.316.1664669311406; Sat, 01 Oct 2022 17:08:31 -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 sg35-20020a170907a42300b00780d58a6ac8si5713310ejc.804.2022.10.01.17.08.31; Sat, 01 Oct 2022 17:08:31 -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=Q1HvutYF; 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 ECE6968BB94; Sun, 2 Oct 2022 03:08:22 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2105.outbound.protection.outlook.com [40.92.89.105]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EF01F68BB4E for ; Sun, 2 Oct 2022 03:08:20 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g5F2RnygQ25jWDyHzqb9YhO2QAht0ckweVVcn+0gVmhIpxDWPMebJvOEZiTELosjMr+o9ClwgazjwU5D4QO5mriLFbONQMm8iZkGm11NmNSp2q0etyKchGrpOPeQE0R1zbkmWcYB882zX6wWgn2l7gil0dSsb/9mcEqzSocESO4w4R4eHG7YjVi9Z1HhSGAvpBneQwQJBUksohB2ic5kh1TFrpDFA8Vs+l8IgZ+mf1aGin3GfjryWfXVrVFh2zNVYkJmYGXD7pljMCEy8VY7PYtANYECGW2Sm9TQPhkQ77fuSg2cKmQQGnOVlt/VhiRZHqTfdfwZfDgwVwcK56CZYA== 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=z+79qgwo6fbgypBjOM/uNai62K4kV0iifknM/RG3nX0=; b=B1QkOAmvKLGK/3kpK6hSpum2FTmoeappyXNLgIuMan52vbX3p6rSc4McejN85A/SUShRRgWSDFHU/JLd9UdJK04UPdV1aT8NtKXvTVs5b9/DxB492uEmAIFchb3Izg9kaMAt/wjG1Q+0GocjRfdvjE/Ry4v63gr2GwXst2HegbdfiLRYf2hLoSaJsyU48mI8+pJCHs1LsTaDwmx9fdHK2j0OqTkaaQSGvbxk2OOUK9+sCBJjahahbbEb48NI9wim/iSQ90eXTN1hj/3XEGAcsz5gWPEh4EHAie1FlaCRJQfSIi5tlzUwLda+0Q2D4paSrF6MvfFGdrf/OzyTu0wdOA== 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=z+79qgwo6fbgypBjOM/uNai62K4kV0iifknM/RG3nX0=; b=Q1HvutYF35se4YEE5iKiIhn8A1C3EEySZ+aLCh0W7Sm05Vp8gcBign7UGxV46yXWcgUY1F106tYPIR8PpBqQo652OPZSCJWJ/NDjF6Egij3zUfnap/ZCcSvkczzrubRg/ij/CbWxwEehDA7CNG+ZBBKLTXm3VOY3nWnNzRKkLDZeVCBNNGctTfbsLEZdiRiF3oVAH+w7jTtl306L2BLEDKxH6ykmXxCw11Sj42DbB8z7vKpRRbx8pMt9z7Oe13BimLKC4bwZD3bdHV53dRPmVQNg1kqnFU4TDNWglH1MlraOn7ohmFIvwjDVML3x9CXcIDxjpfDHzXydbQ2uY4R0Gw== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by GV2P250MB0997.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:d7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Sun, 2 Oct 2022 00:08:19 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5676.023; Sun, 2 Oct 2022 00:08:19 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Oct 2022 02:06:15 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [5gc+03HNv13lmQ8ZO35dI7Sc6HnBHWihyXXIeyvj4Rc=] X-ClientProxiedBy: ZR2P278CA0010.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:50::14) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221002000617.469194-11-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|GV2P250MB0997:EE_ X-MS-Office365-Filtering-Correlation-Id: 7273de41-2603-4285-0c5c-08daa40a3646 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqRS+LhpAttTUY7UGhdHTSoJZzxcn8qZwE5APPAqfP05YIF0xFtTUbXfB79+4AzMII0yY0Hv3Mu1o6ieWeIQhAs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Q36CSnpWlNEYQW3VxkIFd46L1LzoVVuOkjHqtPiE5fZ7IMfUXsmq7C4vNF4CoLJ8aptWGuCn4VQpjd4GG+cuDUm8ZqzsRep9UccBD9UXuXwllXZHl/NZyzSZBorHomj3pg5VMo///EEnXVzyWUT3pTpRDLzSmEuzmzaLnFVIIXzh164sUkrob+Oo1ylA96Erfeu8d/qnZpFq3nOIpRkm6rQSW3b8Bhkz68QV5k6jaa0ManVeKvNcAIiB8919G/mahwfBkjcs3n9cHb4KXwo0DhIYQKyUHSfk1ESV4aPjQLHtikP8sFeEnQMEq/2mcUE2fiFacxvSqThVyRVvaoESSU7vold1zq+3CZ8wMwFYACLMNyNvoTqbms4i9806YKC6CMwErKMzzfM/7+fZORwOvUmVhnGjwtDbAB4LYFY/rOcz4ziGIFXgAue5OSXwtwhd0x/9Mr6kSKScuhvZ694EYrD/P/hZGyn28ecuthx1JhtWnob6GvKMnJCUKEqj1bEBEAtFs3a2ekyHpJIxDXv9VWqLZp0sGWFT3d8W5Jr7UrdpkVtPoPuL/v9dnVnunYF30I/z/hjO5uDoOF5ZMbpC8EXx3mYoSjlfqgjzyKH5nBmZhrsbZ2Tqw/ojaaPGHzcPFrakg89ls= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7273de41-2603-4285-0c5c-08daa40a3646 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2022 00:08:19.5253 (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: GV2P250MB0997 Subject: [FFmpeg-devel] [PATCH 12/14] avcodec/huffyuv: Inline ff_huffyuv_common_init() in its callers 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: AWK2qaVYezoz This is in preparation for splitting HYuvContext. Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuv.c | 9 --------- libavcodec/huffyuv.h | 1 - libavcodec/huffyuvdec.c | 5 +++-- libavcodec/huffyuvenc.c | 4 +++- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c index 4a5bd53998..23a2bb2537 100644 --- a/libavcodec/huffyuv.c +++ b/libavcodec/huffyuv.c @@ -68,15 +68,6 @@ av_cold int ff_huffyuv_alloc_temp(HYuvContext *s, int width) return 0; } -av_cold void ff_huffyuv_common_init(AVCodecContext *avctx) -{ - HYuvContext *s = avctx->priv_data; - - s->flags = avctx->flags; - - ff_bswapdsp_init(&s->bdsp); -} - av_cold void ff_huffyuv_common_end(HYuvContext *s) { int i; diff --git a/libavcodec/huffyuv.h b/libavcodec/huffyuv.h index 92e390ad78..823a091809 100644 --- a/libavcodec/huffyuv.h +++ b/libavcodec/huffyuv.h @@ -93,7 +93,6 @@ typedef struct HYuvContext { int non_determ; // non-deterministic, multi-threaded encoder allowed } HYuvContext; -void ff_huffyuv_common_init(AVCodecContext *s); void ff_huffyuv_common_end(HYuvContext *s); int ff_huffyuv_alloc_temp(HYuvContext *s, int width); int ff_huffyuv_generate_bits_table(uint32_t *dst, const uint8_t *len_table, int n); diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c index 89db3db65a..093070e348 100644 --- a/libavcodec/huffyuvdec.c +++ b/libavcodec/huffyuvdec.c @@ -300,6 +300,9 @@ static av_cold int decode_init(AVCodecContext *avctx) if (ret < 0) return ret; + s->flags = avctx->flags; + + ff_bswapdsp_init(&s->bdsp); ff_huffyuvdsp_init(&s->hdsp, avctx->pix_fmt); ff_llviddsp_init(&s->llviddsp); memset(s->vlc, 0, 4 * sizeof(VLC)); @@ -545,8 +548,6 @@ static av_cold int decode_init(AVCodecContext *avctx) } } - ff_huffyuv_common_init(avctx); - if ((avctx->pix_fmt == AV_PIX_FMT_YUV422P || avctx->pix_fmt == AV_PIX_FMT_YUV420P) && avctx->width & 1) { av_log(avctx, AV_LOG_ERROR, "width must be even for this colorspace\n"); return AVERROR_INVALIDDATA; diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index 0e9b24c8db..5293d32d2b 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -210,7 +210,9 @@ static av_cold int encode_init(AVCodecContext *avctx) const AVPixFmtDescriptor *desc; s->avctx = avctx; - ff_huffyuv_common_init(avctx); + s->flags = avctx->flags; + + ff_bswapdsp_init(&s->bdsp); ff_huffyuvencdsp_init(&s->hencdsp, avctx->pix_fmt); ff_llvidencdsp_init(&s->llvidencdsp); From patchwork Sun Oct 2 00:06:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38510 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp527769pzh; Sat, 1 Oct 2022 17:08:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Z/CCR1Mh2hTqwLtrt+0epApOTHg1MyrJiT9bW2CGRMtcT+Swl8QmmKkI6IEjpfFOGdFC5 X-Received: by 2002:a05:6402:181:b0:456:692f:d0b3 with SMTP id r1-20020a056402018100b00456692fd0b3mr13017930edv.190.1664669320986; Sat, 01 Oct 2022 17:08:40 -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 b20-20020aa7c6d4000000b00457563c4196si4137873eds.595.2022.10.01.17.08.39; Sat, 01 Oct 2022 17:08:40 -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=g23L5md9; 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 01F4768BB98; Sun, 2 Oct 2022 03:08:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-oln040092066075.outbound.protection.outlook.com [40.92.66.75]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D664A68BB70 for ; Sun, 2 Oct 2022 03:08:27 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O2MP1HOLgSzrEScD5ZqiZMYIBQW3qKnX5RAcc+HPrGJbOFbwjuq+6YZpxUoxcWBjlXPTH3A7XFVFbUPtB9MkcfjKhirw4gVENT5Y3T3YIFpCRZUyl8zV8pOYfO/4T3EwvRpIXnXJGc69WL7fzWEmfgfjlixJIYha2Z2+CgRCEFt7vnUNHPekBPwlr9xHfXQ7NXJyFW09ITymNbXiH/ZkfW96LODObI5bnjK2Dm7PZm5R3wtaPNIfl6uY6HdZGAThmK492Cozv2XC+13lEleEeOb545XmB1mBUdYYb4Pta4mKIirC+m1D4A8PW3kYbTyYLRoz83E5H5Ef8DXOZVlbuA== 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=NuzLzpqFIghcLXYAhhaxz/AmlkY6Hi3r3T+Hciqrzlc=; b=Y5wjBrkRy4zXO2eAYT2+Qf+MqIA0bhMfAVop3+ZLcqSHL7SyZWctdg8nAEDIAylxE0qtwbiKIcai4TPabYf6wa33vrqhR4Ijq2FjzsaW6g0PF60143hVQd4UMlAwKjnze3UHRvtIPxKKY6Te29FeXYPTkYJdIAkGQjYFORaczQ4ku1KdRiT1e/awV2q9Csy810wxtdGnMzO7Rak+vCD2zX0X4yiZiIPg1v0qRwiVRmJ/HKaxqPdBg49XwwV+CMELRwXIDSim5PGRgPHTZ6yaIex8UfRXo/oSy7J6oDSysFATE6M2tHzx2XGc+EVaK6xn1Q/CGC5ZN1++3TeKEW3gvg== 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=NuzLzpqFIghcLXYAhhaxz/AmlkY6Hi3r3T+Hciqrzlc=; b=g23L5md9yQnN6vQcFNgJhW0o0w5Us+nSOcJCjJX6UQyGzgXX3iXpeh/HxPC8aCCk2/a+b9cAg59Q4IUMLGG50aIdxEG3/52WIT0W4rSlENtmdU9zw+5Sx5IljSIVkt6/uWuKzGd1z7V4up24eVrtHXte1gkl9iJdJyBTdN4tXWWnE8VqnRDui2begoMR9rC5nU5tu8Hk5TyScDKs6/6pudxrDxJLKAi3ypSySbWjwMgDHbAXQhqat2GpOjJvWE3pRKT6IT41ex/M+KMrQy9MlhoWxdGXtjHHdAWchhx/zCGIQrA2eirrn4c7LVTG31b2Djs/BIlKwxu0V8M+uAlBSw== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by GV2P250MB0997.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:d7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Sun, 2 Oct 2022 00:08:26 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5676.023; Sun, 2 Oct 2022 00:08:26 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Oct 2022 02:06:16 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [kN91erTpNcjpU6rOblEYzQLTSnqBRYkoUrHkFQt/1Fk=] X-ClientProxiedBy: ZR2P278CA0010.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:50::14) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221002000617.469194-12-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|GV2P250MB0997:EE_ X-MS-Office365-Filtering-Correlation-Id: fb2efb0c-de57-46d3-c193-08daa40a3a5a X-MS-Exchange-SLBlob-MailProps: ZILSnhm0P3nPH8ePuXi+6dv+20UuINthAy18GYZ7tfFad5/EgzgU65Xgmlrj17X/6eFQ7WmjtoW+SMl/hwUQ0VDakvxzk03RIYThd8yorqeS2Tgx+/iwlZmg60fQDXxP9H0hNAuDbnsdoyLM8JgYaCoivVurSFFpoyzVCS6w0Y/sKGUmf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gnalvsM68ExVi+gL8N3z9wEoUEzaKhOV3keqdW+78+g/xkSPg48GV36D+4N/dWOQevKaGABXttt5ATtuJvzZUc5DyjlGMG1vUAlFty70qrTw1H/Q3nlQqySCwGZtHTozQadQJpRAAiqNWg1ss8H8rQMZ/Y7HW/nv5d6puu5ARJHYQlf+KXD8plOUMM1jf8vC2nvVKID+WxR8pQyJib4c6VJp84JssWYRKVdTSBADYaNYrr2/Pa7SFIwIxvyW4CFgC7ioCQTcxKzRxFDGmvA8G+4ZP7fm/eJ9XISc3JK+vf7Rv0GpZd4ztooq7FiGvH9wAmX1liKjPiuN+03PbssKnbBm6rC+xWBjelTutpeCtPXwRgC772bm9FqDfkarnj5zQEnHlccH0UxvydQWBXNzyN7TQShzEDQ9HqOwtxUmyiY7c0fZCaTz2su2ggtBzySIRj89whbYNdRkXjG646M3bIA2/+7Rs6T7Uth8e6yCnDDti/n1QhawVPIio4CuxY93lcjaF8xlxFzcgok/r5wM7ho+5GMRL3QLcRyUbfabwWBqULZLLtcBnUYtysVR2Z7qaZEUypyzs4eKQgoT1hFEzBpd5/PS8gAOlo= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fb2efb0c-de57-46d3-c193-08daa40a3a5a X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2022 00:08:26.4032 (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: GV2P250MB0997 Subject: [FFmpeg-devel] [PATCH 13/14] avcodec/huffyuv: Split HYuvContext into decoder and encoder context 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: Ns5KYm1yhOFR While the share of elements used by both is quite big, the amount of code shared between the decoders and encoders is negligible. Therefore one can easily split the context if one wants to. The reasons for doing so are that the non-shared elements are non-negligible: The stats array which is only used by the encoder takes 524288B of 868904B (on x64); similarly, pix_bgr_map which is only used by the decoder takes 16KiB. Furthermore, using a shared context also entails inclusions of unneeded headers like put_bits.h for the decoder and get_bits.h for the encoder (and all of these and much more for huffyuv.c). Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuv.c | 19 +++++----- libavcodec/huffyuv.h | 68 ++++++++--------------------------- libavcodec/huffyuvdec.c | 80 ++++++++++++++++++++++++++++++----------- libavcodec/huffyuvdsp.c | 1 + libavcodec/huffyuvdsp.h | 13 ------- libavcodec/huffyuvenc.c | 73 +++++++++++++++++++++++++++---------- 6 files changed, 139 insertions(+), 115 deletions(-) diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c index 23a2bb2537..bbe4b952b0 100644 --- a/libavcodec/huffyuv.c +++ b/libavcodec/huffyuv.c @@ -30,10 +30,11 @@ #include +#include "libavutil/attributes.h" +#include "libavutil/error.h" +#include "libavutil/log.h" #include "libavutil/mem.h" -#include "avcodec.h" -#include "bswapdsp.h" #include "huffyuv.h" int ff_huffyuv_generate_bits_table(uint32_t *dst, const uint8_t *len_table, int n) @@ -55,25 +56,25 @@ int ff_huffyuv_generate_bits_table(uint32_t *dst, const uint8_t *len_table, int return 0; } -av_cold int ff_huffyuv_alloc_temp(HYuvContext *s, int width) +av_cold int ff_huffyuv_alloc_temp(uint8_t *temp[3], uint16_t *temp16[3], int width) { int i; for (i=0; i<3; i++) { - s->temp[i] = av_malloc(4 * width + 16); - if (!s->temp[i]) + temp[i] = av_malloc(4 * width + 16); + if (!temp[i]) return AVERROR(ENOMEM); - s->temp16[i] = (uint16_t*)s->temp[i]; + temp16[i] = (uint16_t*)temp[i]; } return 0; } -av_cold void ff_huffyuv_common_end(HYuvContext *s) +av_cold void ff_huffyuv_common_end(uint8_t *temp[3], uint16_t *temp16[3]) { int i; for(i = 0; i < 3; i++) { - av_freep(&s->temp[i]); - s->temp16[i] = NULL; + av_freep(&temp[i]); + temp16[i] = NULL; } } diff --git a/libavcodec/huffyuv.h b/libavcodec/huffyuv.h index 823a091809..6cc48bf57d 100644 --- a/libavcodec/huffyuv.h +++ b/libavcodec/huffyuv.h @@ -31,16 +31,19 @@ #include -#include "avcodec.h" -#include "bswapdsp.h" -#include "get_bits.h" -#include "huffyuvdsp.h" -#include "huffyuvencdsp.h" -#include "put_bits.h" -#include "lossless_videodsp.h" -#include "lossless_videoencdsp.h" - -#define VLC_BITS 12 +#include "config.h" + +#if HAVE_BIGENDIAN +#define B 3 +#define G 2 +#define R 1 +#define A 0 +#else +#define B 0 +#define G 1 +#define R 2 +#define A 3 +#endif #define MAX_BITS 16 #define MAX_N (1<priv_data; + HYuvDecContext *s = avctx->priv_data; int i; - ff_huffyuv_common_end(s); + ff_huffyuv_common_end(s->temp, s->temp16); av_freep(&s->bitstream_buffer); for (i = 0; i < 8; i++) @@ -293,7 +331,7 @@ static av_cold int decode_end(AVCodecContext *avctx) static av_cold int decode_init(AVCodecContext *avctx) { - HYuvContext *s = avctx->priv_data; + HYuvDecContext *s = avctx->priv_data; int ret; ret = av_image_check_size(avctx->width, avctx->height, 0, avctx); @@ -559,7 +597,7 @@ static av_cold int decode_init(AVCodecContext *avctx) return AVERROR_INVALIDDATA; } - if ((ret = ff_huffyuv_alloc_temp(s, avctx->width)) < 0) + if ((ret = ff_huffyuv_alloc_temp(s->temp, s->temp16, avctx->width)) < 0) return ret; return 0; @@ -618,7 +656,7 @@ static av_cold int decode_init(AVCodecContext *avctx) GET_VLC_DUAL(dst0, dst1, re, &s->gb, s->vlc[4+plane1].table, \ s->vlc[0].table, s->vlc[plane1].table, VLC_BITS, 3, OP8bits) -static void decode_422_bitstream(HYuvContext *s, int count) +static void decode_422_bitstream(HYuvDecContext *s, int count) { int i, icount; OPEN_READER(re, &s->gb); @@ -662,7 +700,7 @@ static void decode_422_bitstream(HYuvContext *s, int count) dst1 = get_vlc2(&s->gb, s->vlc[plane].table, VLC_BITS, 3)<<2;\ dst1 += get_bits(&s->gb, 2);\ } -static void decode_plane_bitstream(HYuvContext *s, int width, int plane) +static void decode_plane_bitstream(HYuvDecContext *s, int width, int plane) { int i, count = width/2; @@ -723,7 +761,7 @@ static void decode_plane_bitstream(HYuvContext *s, int width, int plane) } } -static void decode_gray_bitstream(HYuvContext *s, int count) +static void decode_gray_bitstream(HYuvDecContext *s, int count) { int i; OPEN_READER(re, &s->gb); @@ -741,7 +779,7 @@ static void decode_gray_bitstream(HYuvContext *s, int count) CLOSE_READER(re, &s->gb); } -static av_always_inline void decode_bgr_1(HYuvContext *s, int count, +static av_always_inline void decode_bgr_1(HYuvDecContext *s, int count, int decorrelate, int alpha) { int i; @@ -799,7 +837,7 @@ static av_always_inline void decode_bgr_1(HYuvContext *s, int count, CLOSE_READER(re, &s->gb); } -static void decode_bgr_bitstream(HYuvContext *s, int count) +static void decode_bgr_bitstream(HYuvDecContext *s, int count) { if (s->decorrelate) { if (s->bitstream_bpp == 24) @@ -814,7 +852,7 @@ static void decode_bgr_bitstream(HYuvContext *s, int count) } } -static void draw_slice(HYuvContext *s, AVCodecContext *avctx, AVFrame *frame, int y) +static void draw_slice(HYuvDecContext *s, AVCodecContext *avctx, AVFrame *frame, int y) { int h, cy, i; int offset[AV_NUM_DATA_POINTERS]; @@ -842,7 +880,7 @@ static void draw_slice(HYuvContext *s, AVCodecContext *avctx, AVFrame *frame, in s->last_slice_end = y + h; } -static int left_prediction(HYuvContext *s, uint8_t *dst, const uint8_t *src, int w, int acc) +static int left_prediction(HYuvDecContext *s, uint8_t *dst, const uint8_t *src, int w, int acc) { if (s->bps <= 8) { return s->llviddsp.add_left_pred(dst, src, w, acc); @@ -851,7 +889,7 @@ static int left_prediction(HYuvContext *s, uint8_t *dst, const uint8_t *src, int } } -static void add_bytes(HYuvContext *s, uint8_t *dst, uint8_t *src, int w) +static void add_bytes(HYuvDecContext *s, uint8_t *dst, uint8_t *src, int w) { if (s->bps <= 8) { s->llviddsp.add_bytes(dst, src, w); @@ -860,7 +898,7 @@ static void add_bytes(HYuvContext *s, uint8_t *dst, uint8_t *src, int w) } } -static void add_median_prediction(HYuvContext *s, uint8_t *dst, const uint8_t *src, const uint8_t *diff, int w, int *left, int *left_top) +static void add_median_prediction(HYuvDecContext *s, uint8_t *dst, const uint8_t *src, const uint8_t *diff, int w, int *left, int *left_top) { if (s->bps <= 8) { s->llviddsp.add_median_pred(dst, src, diff, w, left, left_top); @@ -872,7 +910,7 @@ static void add_median_prediction(HYuvContext *s, uint8_t *dst, const uint8_t *s static int decode_slice(AVCodecContext *avctx, AVFrame *p, int height, int buf_size, int y_offset, int table_size) { - HYuvContext *s = avctx->priv_data; + HYuvDecContext *s = avctx->priv_data; int fake_ystride, fake_ustride, fake_vstride; const int width = avctx->width; const int width2 = avctx->width >> 1; @@ -1185,7 +1223,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p, { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - HYuvContext *s = avctx->priv_data; + HYuvDecContext *s = avctx->priv_data; const int width = avctx->width; const int height = avctx->height; int slice, table_size = 0, ret, nb_slices; @@ -1268,7 +1306,7 @@ const FFCodec ff_huffyuv_decoder = { CODEC_LONG_NAME("Huffyuv / HuffYUV"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HUFFYUV, - .priv_data_size = sizeof(HYuvContext), + .priv_data_size = sizeof(HYuvDecContext), .init = decode_init, .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), @@ -1283,7 +1321,7 @@ const FFCodec ff_ffvhuff_decoder = { CODEC_LONG_NAME("Huffyuv FFmpeg variant"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_FFVHUFF, - .priv_data_size = sizeof(HYuvContext), + .priv_data_size = sizeof(HYuvDecContext), .init = decode_init, .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), @@ -1299,7 +1337,7 @@ const FFCodec ff_hymt_decoder = { CODEC_LONG_NAME("HuffYUV MT"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HYMT, - .priv_data_size = sizeof(HYuvContext), + .priv_data_size = sizeof(HYuvDecContext), .init = decode_init, .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), diff --git a/libavcodec/huffyuvdsp.c b/libavcodec/huffyuvdsp.c index 10723b2fca..fb98836cc4 100644 --- a/libavcodec/huffyuvdsp.c +++ b/libavcodec/huffyuvdsp.c @@ -21,6 +21,7 @@ #include "config.h" #include "libavutil/attributes.h" #include "mathops.h" +#include "huffyuv.h" #include "huffyuvdsp.h" // 0x00010001 or 0x0001000100010001 or whatever, depending on the cpu's native arithmetic size diff --git a/libavcodec/huffyuvdsp.h b/libavcodec/huffyuvdsp.h index e5f5b05466..90e50b5429 100644 --- a/libavcodec/huffyuvdsp.h +++ b/libavcodec/huffyuvdsp.h @@ -21,19 +21,6 @@ #include #include "libavutil/pixfmt.h" -#include "config.h" - -#if HAVE_BIGENDIAN -#define B 3 -#define G 2 -#define R 1 -#define A 0 -#else -#define B 0 -#define G 1 -#define R 2 -#define A 3 -#endif typedef struct HuffYUVDSPContext { void (*add_int16)(uint16_t *dst/*align 16*/, const uint16_t *src/*align 16*/, diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index 5293d32d2b..17d2490dc3 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -31,6 +31,7 @@ #include "config_components.h" #include "avcodec.h" +#include "bswapdsp.h" #include "codec_internal.h" #include "encode.h" #include "huffyuv.h" @@ -41,7 +42,39 @@ #include "libavutil/opt.h" #include "libavutil/pixdesc.h" -static inline void diff_bytes(HYuvContext *s, uint8_t *dst, +typedef struct HYuvEncContext { + AVClass *class; + AVCodecContext *avctx; + PutBitContext pb; + Predictor predictor; + int interlaced; + int decorrelate; + int bitstream_bpp; + int version; + int bps; + int n; // 1<bps <= 8) { @@ -51,7 +84,7 @@ static inline void diff_bytes(HYuvContext *s, uint8_t *dst, } } -static inline int sub_left_prediction(HYuvContext *s, uint8_t *dst, +static inline int sub_left_prediction(HYuvEncContext *s, uint8_t *dst, const uint8_t *src, int w, int left) { int i; @@ -82,7 +115,7 @@ static inline int sub_left_prediction(HYuvContext *s, uint8_t *dst, } } -static inline void sub_left_prediction_bgr32(HYuvContext *s, uint8_t *dst, +static inline void sub_left_prediction_bgr32(HYuvEncContext *s, uint8_t *dst, const uint8_t *src, int w, int *red, int *green, int *blue, int *alpha) @@ -118,7 +151,7 @@ static inline void sub_left_prediction_bgr32(HYuvContext *s, uint8_t *dst, *alpha = src[(w - 1) * 4 + A]; } -static inline void sub_left_prediction_rgb24(HYuvContext *s, uint8_t *dst, +static inline void sub_left_prediction_rgb24(HYuvEncContext *s, uint8_t *dst, const uint8_t *src, int w, int *red, int *green, int *blue) { @@ -146,7 +179,9 @@ static inline void sub_left_prediction_rgb24(HYuvContext *s, uint8_t *dst, *blue = src[(w - 1) * 3 + 2]; } -static void sub_median_prediction(HYuvContext *s, uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int w, int *left, int *left_top) +static void sub_median_prediction(HYuvEncContext *s, uint8_t *dst, + const uint8_t *src1, const uint8_t *src2, + int w, int *left, int *left_top) { if (s->bps <= 8) { s->llvidencdsp.sub_median_pred(dst, src1, src2, w , left, left_top); @@ -155,7 +190,7 @@ static void sub_median_prediction(HYuvContext *s, uint8_t *dst, const uint8_t *s } } -static int store_table(HYuvContext *s, const uint8_t *len, uint8_t *buf) +static int store_table(HYuvEncContext *s, const uint8_t *len, uint8_t *buf) { int i; int index = 0; @@ -180,7 +215,7 @@ static int store_table(HYuvContext *s, const uint8_t *len, uint8_t *buf) return index; } -static int store_huffman_tables(HYuvContext *s, uint8_t *buf) +static int store_huffman_tables(HYuvEncContext *s, uint8_t *buf) { int i, ret; int size = 0; @@ -204,7 +239,7 @@ static int store_huffman_tables(HYuvContext *s, uint8_t *buf) static av_cold int encode_init(AVCodecContext *avctx) { - HYuvContext *s = avctx->priv_data; + HYuvEncContext *s = avctx->priv_data; int i, j; int ret; const AVPixFmtDescriptor *desc; @@ -393,7 +428,7 @@ static av_cold int encode_init(AVCodecContext *avctx) s->stats[i][j]= 0; } - ret = ff_huffyuv_alloc_temp(s, avctx->width); + ret = ff_huffyuv_alloc_temp(s->temp, s->temp16, avctx->width); if (ret < 0) return ret; @@ -401,7 +436,7 @@ static av_cold int encode_init(AVCodecContext *avctx) return 0; } -static int encode_422_bitstream(HYuvContext *s, int offset, int count) +static int encode_422_bitstream(HYuvEncContext *s, int offset, int count) { int i; const uint8_t *y = s->temp[0] + offset; @@ -456,7 +491,7 @@ static int encode_422_bitstream(HYuvContext *s, int offset, int count) return 0; } -static int encode_plane_bitstream(HYuvContext *s, int width, int plane) +static int encode_plane_bitstream(HYuvEncContext *s, int width, int plane) { int i, count = width/2; @@ -618,7 +653,7 @@ static int encode_plane_bitstream(HYuvContext *s, int width, int plane) return 0; } -static int encode_gray_bitstream(HYuvContext *s, int count) +static int encode_gray_bitstream(HYuvEncContext *s, int count) { int i; @@ -663,7 +698,7 @@ static int encode_gray_bitstream(HYuvContext *s, int count) return 0; } -static inline int encode_bgra_bitstream(HYuvContext *s, int count, int planes) +static inline int encode_bgra_bitstream(HYuvEncContext *s, int count, int planes) { int i; @@ -716,7 +751,7 @@ static inline int encode_bgra_bitstream(HYuvContext *s, int count, int planes) static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet) { - HYuvContext *s = avctx->priv_data; + HYuvEncContext *s = avctx->priv_data; const int width = avctx->width; const int width2 = avctx->width >> 1; const int height = avctx->height; @@ -996,16 +1031,16 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, static av_cold int encode_end(AVCodecContext *avctx) { - HYuvContext *s = avctx->priv_data; + HYuvEncContext *s = avctx->priv_data; - ff_huffyuv_common_end(s); + ff_huffyuv_common_end(s->temp, s->temp16); av_freep(&avctx->stats_out); return 0; } -#define OFFSET(x) offsetof(HYuvContext, x) +#define OFFSET(x) offsetof(HYuvEncContext, x) #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM #define COMMON_OPTIONS \ @@ -1048,7 +1083,7 @@ const FFCodec ff_huffyuv_encoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HUFFYUV, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, - .priv_data_size = sizeof(HYuvContext), + .priv_data_size = sizeof(HYuvEncContext), .init = encode_init, FF_CODEC_ENCODE_CB(encode_frame), .close = encode_end, @@ -1067,7 +1102,7 @@ const FFCodec ff_ffvhuff_encoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_FFVHUFF, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, - .priv_data_size = sizeof(HYuvContext), + .priv_data_size = sizeof(HYuvEncContext), .init = encode_init, FF_CODEC_ENCODE_CB(encode_frame), .close = encode_end, From patchwork Sun Oct 2 00:10:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38511 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp528347pzh; Sat, 1 Oct 2022 17:10:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM70czMebxR3jfmrqhLZfPX7CCNARP864I2Xq6MTx9F/Vc9tpkb4DGSL6hCv5i/CP6bLeQbk X-Received: by 2002:a17:906:ee8e:b0:730:4a24:f311 with SMTP id wt14-20020a170906ee8e00b007304a24f311mr11185528ejb.420.1664669428666; Sat, 01 Oct 2022 17:10:28 -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 sh14-20020a1709076e8e00b00781a47397b1si4648550ejc.502.2022.10.01.17.10.28; Sat, 01 Oct 2022 17:10:28 -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=qhKb9OOn; 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 3BCA368BB7E; Sun, 2 Oct 2022 03:10:26 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2028.outbound.protection.outlook.com [40.92.89.28]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7171568BB36 for ; Sun, 2 Oct 2022 03:10:19 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wj4JDBfeF8X2W2Ki5SRSFIjfu77X43qshEQZ7snQTagcq11ckLMqcDPOAAKdhvQPs6vrijZFrjXuwQH/gQBT7XNAb0pJXu6qP31s/71QrBKbFzh/vWk4/Zql9yRAc3kUqadvgI2MHEvdYWifMStZDsPNK4od3RBrmjsAmTL2iD12j+jLaK0anxWRa8+RfcYy6dazvDmQ4XJ5bnmISF0yn/mylr0OrqGVkMIXaap6DVPWuav/34nbzQ1U4tDJusrjf7i9b/fD067zhJjsHLBzsl7YqQhRGGU6b+PkXakwIPAixZB1kbxLB6QTvPsbRFUpNSNd8hvzW7/Y+8Tp8Tfa3w== 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=xHDa3FXSs65OuKkvHEO3vOQ04qhj0dzMyhSCth4JP/o=; b=GdVExmvcXIJtc2CGo6AKviG9EXAmQsfylZt7CQFAesxxy9NoSL4Xzae33USy4a2qfyi1V2eSy6Vq/YmdnljZnA4w98XVsJ/GODvqJL52SHEAcftUWuSNerDSZWe+PGeeXh1pWQv0fgMP5TuOmq27a4wk3y9S5O2vDInBp9n5chfzNy4JV3ZtpkOsobQSF45zMqraVUsXJbtieUgwxdVVcPyfDQ1cxJEokoJfjZGiajYqmV8PJj7HQK0UtPk9L12s2C9FxYR1N51s7izfJcBm+qkcGSmKL0X08BHstH8Or1bW6fSeeYAbxPkeBDgQt15L44+6lgc8tlC5dcax/Or2RA== 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=xHDa3FXSs65OuKkvHEO3vOQ04qhj0dzMyhSCth4JP/o=; b=qhKb9OOnmTjewVHymVKrUaQeH5m5PxCznqiqSTPrF3JkRvojF4Q3gHji+5aIxJzg7MHLoBx+DhG7lOVy5ePB8ng2GK+iJOE9m3fDde3/Q8TkTnlCkGmDwbwZQR9x1pDviTxL9+v6lMl24+/jkjPSqqahnf8VhDH1u8ie07ZEF7zuFBnfY+avgW0rDXD4geTGtpnLi/esZ5J33bPnGehaSikOhRaajO+XKg8rCX7a9qvBXgYN8fmxsaslQF8cmk8mifGp85fQZ850DBbYxt2dFOU2+X1BbuzvTqlaWDVBtfm+3Inx03C5/eY9yUXIi5IRCRf6hwALY/l9gCGBx2GI8w== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by GV2P250MB0997.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:d7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Sun, 2 Oct 2022 00:10:18 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5676.023; Sun, 2 Oct 2022 00:10:18 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Oct 2022 02:10:17 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [6eqAGnRtHJsBTNXjmXJWvRLJZMX38ksYTLxU+eULajk=] X-ClientProxiedBy: ZR0P278CA0082.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:22::15) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221002001017.469643-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|GV2P250MB0997:EE_ X-MS-Office365-Filtering-Correlation-Id: 78841504-cfd3-4a48-dd4f-08daa40a7d00 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqRS+LhpAttTUY7UGhdHTSoOsstw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kjx6i9wkJnB4JfqwYRskuZUuSVLMFCQ2b/1Vlu2xORsf0+/BqxpuKs+Af58LOOmsruymVLq6sabS2oL6xLIDD/vGIvpSTzo6pvRo6IlBCSpNZk7OkIwoT+Pj4GDLME/qA24KoCPRU87DZ1E25TkjcRV2YB/o/FaTdjmPkRSiiMUk8POZ4pdZm7dMVdhAxWFgDtowar4aS0sTtDpqIPGbcc6fI7cRMZhXb2LhS1DyPSS8eZCybnn3z3BiyHMQvMdWfBdPrfw4zXuuJ5TIgrG6go2TURkxo0FAZW+7Jqn7Assg02O1jsr2yLQS+bWyxHLHAtI36q1oq0+QGNJx5oEYD5iEN2HFnGeswqGyS+ohYdYrDqkZQYDb5rWT7dFjfnnm0RH6EkJOCUGI3DQLXLNsJlUQDd7SYV3Xqk+y+0z1tLAzytwoSPj3tBzPDq9MMb0dhaw0YypfDdgdfBeX4My9qpvoDf0HO21Oyb6U93eFo+aNUY3vi3LciQCdhI2Wvak9W0g5pWcG6XREyVYw7r1h6psq8XMCaDHfGz6SqJTMlSf0DL3ze4Gh++/4uuN32WT8X1AkqfMa4nQtkwQRYbJHu/XigBOaOh6GDiM2OvS5FqibZ3Q1rPMsKtNonwRdcJOqSxPpOr4SGoTUzHF4YLqguguuEwyiMBBikAURVPfX6DgZSFSTdDtRVHxd7xdcnTkj6oS0LRpPWicFbdvNGukIZVcY= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78841504-cfd3-4a48-dd4f-08daa40a7d00 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2022 00:10:18.2059 (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: GV2P250MB0997 Subject: [FFmpeg-devel] [PATCH 14/14] avcodec/huffyuv: Speed up generating Huffman codes 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: CLtRED4Sg8wO The codes here have the property that the long codes are to the left of the tree (each zero bit child node is by definition to the left of its one bit sibling); they also have the property that among codes of the same length, the symbol is ascending from left to right. These properties can be used to create the codes from the lengths in only two passes over the array of lengths (the current code uses one pass for each length, i.e. 32): First one counts how many nodes of each length there are. Then one calculates the range of codes of each length (possible because the codes are ordered by length in the tree). This enables one to calculate the actual codes with only one further traversal of the length array. Signed-off-by: Andreas Rheinhardt --- Given that the long codes are to the left of the tree, one can actually use uint16_t here despite the codes being up to 32 bits long (so many leading digits have to be zero that the codes fit into uint16_t). libavcodec/huffyuv.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c index bbe4b952b0..6bcaacfc37 100644 --- a/libavcodec/huffyuv.c +++ b/libavcodec/huffyuv.c @@ -39,19 +39,23 @@ int ff_huffyuv_generate_bits_table(uint32_t *dst, const uint8_t *len_table, int n) { - int len, index; - uint32_t bits = 0; + int lens[33] = { 0 }; + uint32_t codes[33]; - for (len = 32; len > 0; len--) { - for (index = 0; index < n; index++) { - if (len_table[index] == len) - dst[index] = bits++; - } - if (bits & 1) { + for (int i = 0; i < n; i++) + lens[len_table[i]]++; + + codes[32] = 0; + for (int i = FF_ARRAY_ELEMS(lens) - 1; i > 0; i--) { + if ((lens[i] + codes[i]) & 1) { av_log(NULL, AV_LOG_ERROR, "Error generating huffman table\n"); return -1; } - bits >>= 1; + codes[i - 1] = (lens[i] + codes[i]) >> 1; + } + for (int i = 0; i < n; i++) { + if (len_table[i]) + dst[i] = codes[len_table[i]]++; } return 0; } From patchwork Sun Oct 2 14:46:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38518 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp823565pzh; Sun, 2 Oct 2022 07:46:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7FS5Szs2xvSRZDQYcmlz1FzSjHeSgY6cZQhi2Tlg0RY+3iQFeZehw8F08V9abMBCuqGJ/k X-Received: by 2002:a17:907:8a1a:b0:783:182e:aa00 with SMTP id sc26-20020a1709078a1a00b00783182eaa00mr12687860ejc.65.1664722010144; Sun, 02 Oct 2022 07:46:50 -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 cm4-20020a0564020c8400b004517679cd84si2420423edb.51.2022.10.02.07.46.49; Sun, 02 Oct 2022 07:46:50 -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=PJ8K1cb7; 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 A260B68BB5A; Sun, 2 Oct 2022 17:46:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2033.outbound.protection.outlook.com [40.92.90.33]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6DDA468BA0A for ; Sun, 2 Oct 2022 17:46:39 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c6m8eaJ26PttE/YXHSwGBSDu+q/T7OqZxtddIJcf5epykWNycyzETJWD+ZT6AiVdQ0ES1QRHIQ4WDaIVpPMLf2C8+oCWkUHHPMYrF7FCSAZKds2YaaDY8aILQpNjZwIxX5Xk6ojcy4I03Wo59VDp6G2BMj2vvqdvH1GshC74igxPtuEEKLv70cBSgtFY5X3Nl8s3T1sfPCOGx1qRJoBwbCS+04qxDjyPpKIVvbgZruigbBncE39fKGPDc4suOEn3YYGWuq7fu6Uy1rdkyoALcYqprNJWuhHF9b6bcO5sAXZio4u7OY1uWPoXTRu+bduorCFGy2crcoVbmmJ/kHxxbw== 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=bP/HW9KtNTdA6ANjhjVOo6Zkz6vSnnP1kpKZdbJx9Vk=; b=k1+3QMxa03Lo8YyGdvCrhc4ehfg99qm9NUoIlYJG6I/4jJcODjHENWJOIkctBvreN7Sp9+rmJa9WtMKbodVhgi3bypTmBV9PO0tna1z9GN0nr2u3QyJ4hinSkmcyirnDOKoIXixjgEy9EMeRHEq8/mDFvlXp8lJ7N0Eg/fiWIdK6VRMkLLSWHL3Em5Jo5Mz8bSXCvVM3+FwFqsutldrBkiI7VRXFkQlK5KkS5/BHHyCjdaRQ3rQ/pbYoGTVtCnWJnclvjVEBege6H/T2WhmU+PwyeqS24GMUZtbFPZ61NneQ5ogVYBHZaiu0jfaRHwrHPi60M8yuiWurLbRyENjlZg== 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=bP/HW9KtNTdA6ANjhjVOo6Zkz6vSnnP1kpKZdbJx9Vk=; b=PJ8K1cb7eUmG/9EGzkSvCdkU/urFuyCwM+FPePIdgwYPZqJLNFbVHgsg6UafvCAfwxQ5kt+1FcMLeidebNEns7pHAQJb88g4S585lqNTNUHrBvXFnOM9BAxeFM4b+dvaNrNVEhjcKSKRLp4mhQ6oeObFC+7bUaY+A4/6wCSaYrDl/mc8gDYB2mak6EgNoGlUuI4yyh9QEO5EIw/xIbwvsnkqolTQDlSCMGv9xuLzG1o8mTKwdZJYPmYxirp/GRRVY9nUL1RziKxou4St6aL5ZVk7WIXz5jt7psKsSfq+tSRIzRJitEUCVaD0JY2kllVUUD/mFuoMnTm8t1kM3vQOaQ== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by GV2P250MB0997.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:d7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Sun, 2 Oct 2022 14:46:36 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5676.023; Sun, 2 Oct 2022 14:46:36 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Oct 2022 16:46:36 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [zAzaJi/czDHNNBGYZhhBA7Nmb/o3RD366Bp9lwvxuK0=] X-ClientProxiedBy: ZR0P278CA0062.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:21::13) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221002144636.482596-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|GV2P250MB0997:EE_ X-MS-Office365-Filtering-Correlation-Id: cafe17fa-4dd8-4517-666c-08daa484e819 X-MS-Exchange-SLBlob-MailProps: a+H6FLLcF3qr9vLYJ+vPiB+jT1sXvwfA5wz26abjzqp+8gNCgTv1UE8M7DsKVhd/JCl7GPNtFMJRuflwTIXDp5HESqlr+0HdgoEwusFEON/GhPVPgc/KMbEBueV66NUzQRHMfP83HolFp6R1R0/Jp6xDG5RoeusL3n8R7we4q6GACx3U/7l35K4PDFPzR8Xe2F5nVy2NLGLSfH/o8ISiDxV+VsiXesPYBBw3v9XfjSBgL5L/uJPML8fJT/ABH8Lt+BBYYoY1OuBrxlK3xzPDLplp0K6Q5KEK9W+86IdxuGYRG5u3GfBZamic8GooixoGyRS0uTOg0A2HDFu4Cw9l1ULgjyhRT/4IbOEdNpAvUrkSpHHWVqW3Ieu9H83E3JAOvndV2lr3Y7wO8prCTdpQl3oR5q4UoNYrEvIyyVzZr5q12aVww5dTj2Bwhl4CARtY+49qiNQTV/VCbLXRaWBzvMBaP56+AwkUBM4qam18nPemiebBTblrWWclz+RHv4sNcC3bTzzbmidEX5BRYj5uBfrDXVCz/RjDJrY0oTb1VHiYBXw8FsZJ8DJDnzNAxcPreDaMLmDeyvvy82goIuPQYAxgKYFWCAoTZ3jWyHJnwmclu5QfW0mochqewWTYBQVOx5nTUU/vYsIvizfaqhUjPoQ+2s5vjhXKmlZIkQpYDR1oOk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x3KCSDJM8K0aiMdh+pppFOiDiZuTU7OtzB7BJYzsT7zdMuWkCuxO230rO690f+FENEL3e7DlNDtss9k+qIMYurGO+AAoRqZ/XFmO3XueyBwuXE2cFL6GRQ6jWTrYFlbQcTq8xoZ3JQHIg4nBkziiIMI0OkyjvQP2jqAbDQlMBVYrOT+ X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cafe17fa-4dd8-4517-666c-08daa484e819 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2022 14:46:36.5619 (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: GV2P250MB0997 Subject: [FFmpeg-devel] [PATCH 15/15] avcodec/huffyuv: Update outdated link 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: q22L8LDWzu88 Signed-off-by: Andreas Rheinhardt --- libavcodec/huffyuv.c | 2 +- libavcodec/huffyuv.h | 2 +- libavcodec/huffyuvdec.c | 2 +- libavcodec/huffyuvenc.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c index 6bcaacfc37..aaba313bf1 100644 --- a/libavcodec/huffyuv.c +++ b/libavcodec/huffyuv.c @@ -3,7 +3,7 @@ * * Copyright (c) 2002-2014 Michael Niedermayer * - * see http://www.pcisys.net/~melanson/codecs/huffyuv.txt for a description of + * see https://multimedia.cx/huffyuv.txt for a description of * the algorithm used * * This file is part of FFmpeg. diff --git a/libavcodec/huffyuv.h b/libavcodec/huffyuv.h index 6cc48bf57d..22a766611e 100644 --- a/libavcodec/huffyuv.h +++ b/libavcodec/huffyuv.h @@ -1,7 +1,7 @@ /* * Copyright (c) 2002-2014 Michael Niedermayer * - * see http://www.pcisys.net/~melanson/codecs/huffyuv.txt for a description of + * see https://multimedia.cx/huffyuv.txt for a description of * the algorithm used * * This file is part of FFmpeg. diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c index a065185986..7d3515cc88 100644 --- a/libavcodec/huffyuvdec.c +++ b/libavcodec/huffyuvdec.c @@ -3,7 +3,7 @@ * * Copyright (c) 2002-2014 Michael Niedermayer * - * see http://www.pcisys.net/~melanson/codecs/huffyuv.txt for a description of + * see https://multimedia.cx/huffyuv.txt for a description of * the algorithm used * * This file is part of FFmpeg. diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index 17d2490dc3..db274e37ad 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -1,7 +1,7 @@ /* * Copyright (c) 2002-2014 Michael Niedermayer * - * see http://www.pcisys.net/~melanson/codecs/huffyuv.txt for a description of + * see https://multimedia.cx/huffyuv.txt for a description of * the algorithm used * * This file is part of FFmpeg.