From patchwork Tue Feb 1 13: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: 33988 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2c4e:0:0:0:0 with SMTP id x14csp602784iov; Tue, 1 Feb 2022 05:10:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxS9KRZ4BxcMYl8ARJGpMmFDeeeJkBWJpTvgoLVZAyDWlnHQ2n9YFUVK+uaYuJiWVT9W4VB X-Received: by 2002:a05:6402:3552:: with SMTP id f18mr25413623edd.189.1643721004884; Tue, 01 Feb 2022 05:10:04 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id b8si9078954edk.124.2022.02.01.05.10.04; Tue, 01 Feb 2022 05:10:04 -0800 (PST) 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=QQIFeTGs; 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 21CFE68B2BA; Tue, 1 Feb 2022 15:07:46 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-oln040092071051.outbound.protection.outlook.com [40.92.71.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2F29668B2EB for ; Tue, 1 Feb 2022 15:07:42 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FWrEr2bKz/L+O5uOkuadkkEmbhdTx86UHtvlcOxKqi1yJpfzLa+AyxpcIFUPMYF0K0sExRNiM8lqcqqbK1QC5mHJdL1kG2EWHfwETP0dX3rR/xqOydEgdjjyFN9gw6iceJaKs1DBUb7hvitnrsLoxEMiM9zyQtUXbe8CnZ+DG8B0QqT2FUN31Hq2n4J8CDRSaPmYLcH5bvoXXL9WxMN1J5ggphph/oQfvhldZG0pBIYYGhD1/vH2b9BXdyUXCdMXPjK+OjsA9u9CRW14R+/Zw+5YMv0knEXl/bwHXWU4fMDjGhDeLosruY+CdQHnweKysGx0S4qI2FLEkr6mxvVvQA== 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=EQJ6TbADBp7sOYL5d6gtkwfvykV6TkwO7bhYAxi4sgU=; b=m2jGXY9JfzoGMWNDE/SKF/8mfKcQjShqyPFjWeUptUD+hXNQ7swEOFPT8l4A1mMulcnOf44gS3OnnrmHoC2DXVdUg8HJjdiuMvbBieCXpOaEpqb49Er2Zcko0hgDJygI/aqn1DEAQyP9LEDqB7nH49y1qPk42XhRe2mSUdb74VJp0kM5lHdCce1h31fpUzrT38X9Bp4EPEYXtaH0gIhmoo9Im6Oj8whr5C4zO76FFMfuFoy3DpRu16SkgVfQeimiq0tbCXS9MhfnFi31Sj6ytKwz0fpAzhz+sDwi3KL9RdwP2YOuc+7tPBm3h04Sm4tHduHPLBFQUyZ1lUuut28ZwA== 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=EQJ6TbADBp7sOYL5d6gtkwfvykV6TkwO7bhYAxi4sgU=; b=QQIFeTGsiGdbMu9rrfFDanl0WeV+1UbXcekyzWwz7Sq8pHgi/3nKI442udqeiCkH+37D914vBbfDfJNT39RpnoS9msCbe4syvpRhivHUsoWyLLF0sSbxEKV6TjdViWAgw1HQXRnfVpf6uGRGiQgroPTAYHdQDXExbaLJht7kL8pOHbkBOgE69iSxH9m64R7/+1KyKkVa43XWEGdf6+oPtnJ3YPV/0pTZfukTZSi4y1Uc31yuSSbVTJzBc8JFGj82XS9a+VaVdInooNgluzPu0omkI2ipFDiA8tXS/fx9kfcCChbhzWPpWF2Fq1ZFVwbsru09awRJSxhwF+hDqXNiWQ== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM9PR03MB6948.eurprd03.prod.outlook.com (2603:10a6:20b:2d9::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.22; Tue, 1 Feb 2022 13:07:37 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::ac56:2ff4:d304:ab22]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::ac56:2ff4:d304:ab22%6]) with mapi id 15.20.4951.011; Tue, 1 Feb 2022 13:07:37 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Feb 2022 14:06:11 +0100 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [fK6WatnxIOBK/Axu2TxNkMAuHvxvgBF+] X-ClientProxiedBy: AM6P195CA0092.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:86::33) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20220201130706.1420875-13-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b8db2503-00ce-4324-5b3a-08d9e583d1bc X-MS-TrafficTypeDiagnostic: AM9PR03MB6948:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TtcVxg7Eg7ITF8F9EG7AJV/CLyw8jbaawSSBZhsCHfJfFfHqgpucsQItWL0sHten2aqnZO1Z7JeKFWSJFW49FAgKgsd59QUXoG+x7WaS8EQsr8B69x8KcXORHnioqnK6yaiFTFcjITJ6Wyol0OxaTex3AfLX3ivCdMtJ1orwZdG5pEAOUQxESLxxDWw4rQxYm6yIh/3DwFAG6K/3ZVcBP0Mv/F5la+lfo91xg2l9SOapqVACnsexPSQg5PqUHl31MpwaYxzG8qyCFHgpdTQkcjXWGOL7HVn5txxs723miOX3AyVEuA2YFe4TIWfRmk4E7VRbF8XTDbRYHvwQ/WvE9jLlNdEQ2XnahARDWDLepsFnODbVKwos0b6yunmeVRMT/6lAjj9EhHQYCGG7olFBUmvJM+1e5QvRHa44as1HXg9cmA26VBVlCagULAikFzanC+D+ozcINCsVJtx+17QWRmzppcxUdxGqmlwCYS2n2fd+U9/UqiYsJuLfCTW5oRi8i4pwFCerA26b0EYgIxjBVvrmxNikrP/CiMORQxvwrDzdjxkY22DJnPqESr0D5mx5 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pwglltVoPFGJPYlcVl5X4uOmSTR3pTuC3DOA0wOXFmDLks9cnJdp1j3sVJBs6fLBvPoBchK6LfjUd/lK/syeyddg+bSEw4xanvAv41oHvKi/rUf+BjvLrKLQwHQ1dxf9wFfTiuqpQUPvfViBn/1tgrzgJkfJshgIzlc9ZHuu0Kp1yiQedji8Vd6h/rap+A8QsCUXiaVBSQ16rXkNZ20xCk6J477WbOQA8Sc6GDCTz6UNs4pxIUainH159KLeMAbX7JpM+gspd6v8EwpFQpcC+AkRP96ig2HR9BLNStqoOnYbymoFWuvDZ9zs3A1nRYtEZJ8mprb5+YkEJTuWMObXIHx0DJUOKd6rAcdHDl2jKUiOCC0e5kAY9kSyrsav/JgDOrHtsOsU77dufFHhnWBJMxHvd0GDwogPdwNuKYuJ7NIfyxT0fHXOZAjXv26CbKBMwt4opYyGRduEtA1xU3kV8/iMun+AeHCyJY1wNEtY9sh1qx4HB9J2hxMFHBqCEu0SuxaprhJd/a+9veG+PI5u4aAeePnewuvTpSAXaRgcgSN2kl8iRGnFPz100hPaP8o6kyCKwJkb53PhYOqW7KGLIAT7CGAWgzgonCB7N7v7oMi4tdHdofJSaWWkSMjsHcycL10Rey+zjd8A6TuSc4MBwRNZKFeLO37N23itOb7BzQ4rabnMFNMJTbh04HEGRAmyUQ4IHGAUhxRlnHPQWBKBio4HNH/+rWhNUWcSU424Q7EjgT0nB8AcHIsc7/blqAcxViGo7hxndTx8wEEvU/lRVv3/yrLrYntNzGBR31dSju4doykTpjJmM2NuNVsHlaM5HTChMKSeB/CXzkLFWE7JgJO8sjLd70iumMdwuemEDfVjAkdrYzXYNsF7HNBCnZYvoU0VpR1xoD06eOgBdTsL6ir7XIIRuZ1k0t7Yxtexj0M3kfx886+6KBj54slS5/Bpv44eu+By47/NA6XicyQOlg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b8db2503-00ce-4324-5b3a-08d9e583d1bc X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2022 13:07:37.2676 (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: AM9PR03MB6948 Subject: [FFmpeg-devel] [PATCH v2 14/69] avcodec/msmpeg4.h: Move decoder-only parts to a new header 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: PqgYNbqPIe11 Signed-off-by: Andreas Rheinhardt --- libavcodec/h263dec.c | 2 +- libavcodec/msmpeg4.h | 23 ------------------- libavcodec/msmpeg4dec.c | 1 + libavcodec/msmpeg4dec.h | 50 +++++++++++++++++++++++++++++++++++++++++ libavcodec/mss2.c | 2 +- libavcodec/vc1dec.c | 2 +- libavcodec/wmv2dec.c | 1 + 7 files changed, 55 insertions(+), 26 deletions(-) create mode 100644 libavcodec/msmpeg4dec.h diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 0812912f17..5a54d57bbc 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -46,7 +46,7 @@ #endif #include "mpegutils.h" #include "mpegvideo.h" -#include "msmpeg4.h" +#include "msmpeg4dec.h" #include "qpeldsp.h" #include "thread.h" #include "wmv2dec.h" diff --git a/libavcodec/msmpeg4.h b/libavcodec/msmpeg4.h index dbe650cbbc..6dd16d3957 100644 --- a/libavcodec/msmpeg4.h +++ b/libavcodec/msmpeg4.h @@ -24,42 +24,19 @@ #include -#include "config.h" #include "avcodec.h" #include "mpegvideo.h" -#include "msmpeg4data.h" - -#define INTER_INTRA_VLC_BITS 3 -#define MB_NON_INTRA_VLC_BITS 9 -#define MB_INTRA_VLC_BITS 9 #define II_BITRATE 128*1024 #define MBAC_BITRATE 50*1024 #define DC_MAX 119 -extern VLC ff_mb_non_intra_vlc[4]; -extern VLC ff_inter_intra_vlc; - void ff_msmpeg4_common_init(MpegEncContext *s); int ff_msmpeg4_coded_block_pred(MpegEncContext * s, int n, uint8_t **coded_block_ptr); -int ff_msmpeg4_decode_init(AVCodecContext *avctx); -int ff_msmpeg4_decode_picture_header(MpegEncContext *s); -int ff_msmpeg4_decode_ext_header(MpegEncContext *s, int buf_size); -void ff_msmpeg4_decode_motion(MpegEncContext * s, int *mx_ptr, int *my_ptr); -int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block, - int n, int coded, const uint8_t *scan_table); int ff_msmpeg4_pred_dc(MpegEncContext *s, int n, int16_t **dc_val_ptr, int *dir_ptr); - -#define CONFIG_MSMPEG4_DECODER (CONFIG_MSMPEG4V1_DECODER || \ - CONFIG_MSMPEG4V2_DECODER || \ - CONFIG_MSMPEG4V3_DECODER || \ - CONFIG_WMV1_DECODER || \ - CONFIG_WMV2_DECODER || \ - CONFIG_VC1_DECODER) - #endif /* AVCODEC_MSMPEG4_H */ diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c index e1d2c342bc..a7870f252f 100644 --- a/libavcodec/msmpeg4dec.c +++ b/libavcodec/msmpeg4dec.c @@ -27,6 +27,7 @@ #include "mpegutils.h" #include "mpegvideo.h" #include "msmpeg4.h" +#include "msmpeg4dec.h" #include "libavutil/imgutils.h" #include "h263.h" #include "h263dec.h" diff --git a/libavcodec/msmpeg4dec.h b/libavcodec/msmpeg4dec.h new file mode 100644 index 0000000000..af2591caf5 --- /dev/null +++ b/libavcodec/msmpeg4dec.h @@ -0,0 +1,50 @@ +/* + * MSMPEG4 decoder header + * copyright (c) 2007 Aurelien Jacobs + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_MSMPEG4DEC_H +#define AVCODEC_MSMPEG4DEC_H + +#include "config.h" +#include "avcodec.h" +#include "mpegvideo.h" + +#define INTER_INTRA_VLC_BITS 3 +#define MB_NON_INTRA_VLC_BITS 9 +#define MB_INTRA_VLC_BITS 9 + +extern VLC ff_mb_non_intra_vlc[4]; +extern VLC ff_inter_intra_vlc; + +int ff_msmpeg4_decode_init(AVCodecContext *avctx); +int ff_msmpeg4_decode_picture_header(MpegEncContext *s); +int ff_msmpeg4_decode_ext_header(MpegEncContext *s, int buf_size); +void ff_msmpeg4_decode_motion(MpegEncContext * s, int *mx_ptr, int *my_ptr); +int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block, + int n, int coded, const uint8_t *scan_table); + +#define CONFIG_MSMPEG4_DECODER (CONFIG_MSMPEG4V1_DECODER || \ + CONFIG_MSMPEG4V2_DECODER || \ + CONFIG_MSMPEG4V3_DECODER || \ + CONFIG_WMV1_DECODER || \ + CONFIG_WMV2_DECODER || \ + CONFIG_VC1_DECODER) + +#endif diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c index d7a19f6ad2..dcf91f9828 100644 --- a/libavcodec/mss2.c +++ b/libavcodec/mss2.c @@ -27,7 +27,7 @@ #include "error_resilience.h" #include "internal.h" #include "mpeg_er.h" -#include "msmpeg4.h" +#include "msmpeg4dec.h" #include "qpeldsp.h" #include "vc1.h" #include "wmv2data.h" diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 7ed5133cfa..89cccc1929 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -33,8 +33,8 @@ #include "internal.h" #include "mpeg_er.h" #include "mpegvideo.h" -#include "msmpeg4.h" #include "msmpeg4data.h" +#include "msmpeg4dec.h" #include "profiles.h" #include "vc1.h" #include "vc1data.h" diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c index ddf68545fc..7121468ae9 100644 --- a/libavcodec/wmv2dec.c +++ b/libavcodec/wmv2dec.c @@ -29,6 +29,7 @@ #include "mpegvideo.h" #include "msmpeg4.h" #include "msmpeg4data.h" +#include "msmpeg4dec.h" #include "simple_idct.h" #include "wmv2.h" #include "wmv2data.h"