From patchwork Tue Feb 1 13: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: 33987 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2c4e:0:0:0:0 with SMTP id x14csp602606iov; Tue, 1 Feb 2022 05:09:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZupLciOw6WtCz9OXiX92hDu5KRXCKQbxKecBCIUSEsAwhK7amw3r21rEYOJJ4hFypFvAE X-Received: by 2002:a17:907:1c90:: with SMTP id nb16mr9314922ejc.413.1643720993230; Tue, 01 Feb 2022 05:09:53 -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 ht13si9793818ejc.850.2022.02.01.05.09.50; Tue, 01 Feb 2022 05:09:53 -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=VTUPisUf; 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 278BD68B30C; Tue, 1 Feb 2022 15:07:45 +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 EB9CC68B2EB for ; Tue, 1 Feb 2022 15:07:41 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PdURrdvCeA59vaunJtdPCtNqUaqaa1CEuiDC2WtzWdcTzT7VlDl0RvmdFRKi1r14GMxNTLA465rKMXm+eck4X80gE8rAXpZZYl6ACUneanrUo9pt/ZJ6yCZLpZR5pFl80S/oG0K3BCQ2/khhBBLEW4ToSPLVz1uvdRacXyfvDtS8mia1ZYe2AsxGHifvDm3v1IIvIRYrq/188Oze7pad/9n42hWbdXIvVuVdNSJ9mecKZpCUfR+/jhAy3nGEkAMVaH+Ofta7sdf6RrGJmctEPE+IzLMGDDcxRHGft5/Em9UUeqc9EH2PqJYzzTcnEpBj8Q27xakD/S5r0AVnsDok5w== 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=scA2M7R0upie+8r5kjIThLy7FoOdJDm/O8ZZl4TkOvw=; b=nj8Qwo1a8rU619STILpRqVct4jHw2jR+9E0t+30cP1QNows19zDXhx9rVyjP/by80L+yyi3YpVq5a5jxxTQM3e+/8KBsHwvUGhzhyOQhyjDNRd8J2Hjr51fmQFK42+cOEie4Na2s0/Qzoc/UNvi1OB5AJeGyy6nBvnDZVQEtGMp98SlL0F07ZfxYbTk2i4aV7fQB6J3kMUeW3Oo+mHNDqgp5nEobZnAE4D1noU7Kcjmaddg3szqeGyIyvLTHCBveg6y/hImn8za+TDQIjdREsMrLYZFJCH6eOpa+/Hi6kT7XwUSK7bsVwd27ZsLDbHk/tZIIG/2Lj6sOmRgSMmKEwA== 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=scA2M7R0upie+8r5kjIThLy7FoOdJDm/O8ZZl4TkOvw=; b=VTUPisUfU1VAHy8cICvxsjqD+GxqJmOSs4vklQK4X1AM3MU6VvOzQqOPne0qEF/puqSP9/UXFTp0i9YjQyClMMGp+xwZEdNHP9ed6GK7lHKRUf17cSS3DWRtDaUVpNeZfV4bsWqEaoiSkuvaigILC2wN8uwDPGhFWjQOl2PgUIjJjOSW3zwOtI8ncWc/T7i9t+2/4HDx9Xrq3H7BcJXHyHnQQ8jq1jlUr0OHgY3KowDHY7Hq9TOapVatqgym+W25qntVqWdaaCxGSy9GH6c3v7lLuwIShgMUgEnrMNtZhUVq6UG+oUodqP/UAuLI9TRLkJfeIzIi51jo7makG/e18w== 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:36 +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:36 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Feb 2022 14:06:10 +0100 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [fYOzoWHu/5hQax1ymY7EeJDL0RIc63ot] 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-12-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e9a9cf8c-4c52-48de-927c-08d9e583d109 X-MS-TrafficTypeDiagnostic: AM9PR03MB6948:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VKeUlAe2WTAyoKlQi3Il/bBd6b90LIWBWRB7FFFqCRS4wNG4Li7KWjnjeEoyf75k7FlUzhE4uDXd374Abe6L/y3K+6kGdHOTFqVe6wTOStQJqaF90Kk0zu+p23kt+pDmwICvJFo8JW8Q6sYtipsraU0/uUmO5JwVAn9sk8DydNTz9+fRi0Arv52WiJ6YA9ARXMnBY2vOKziAXOIuB92aKRmaBuKTJUIVWu+jXXlfJdmZcYeXI4x63DdEcACxkgiUAUNhpMs6Gf+/+z7D63N+Vpl+r4D57or7P6mYiHBy3oh0Q9+n8BI2WJkR4Vgv+gP08LWTkDIopphZuLC37idUWwKTGJ8R4J9l6uAmmD5RJwKlGeaOpx+7XjAanziPq4xIdT2mtMaBqr44aH05kHPRxmop3HIxH3KLPiRG6vvBKnXDr0VuX03v8AZgMEvX4ap0S0D7eQlrLX46/BYj/2jK0Y79vk87epZIc2jHIPBxNAGh24saZHpOl4cHLYhQ/U63Iq6F2Ynyzlwmk6Of45kG8Ir7lTpHAIJ0Fp7LuKZrE8o9WqigN6+NSMmF5yl16cDR X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EZ3mlHVrw2bwqn0cv/Ts8S8tNRdjp3FYaHWg54wt+tGIgWDiLjmns1SfZCftkw0SJgcgcI1WiVE9uWCfWfQyWnBw4Ity1ZVZkgpOlMnBFjAe0952BRjsdLmuNYB0l7HXPk20SYTzOZ+6tZKtHoyCGMebr4etnYB+MNfRrREO2fOlxumFiZLBdB4+qD2qesvUcrrY24UFNMwrD44scvDy4LiELEBXp1U+qHO3D1ME9DVVpYM4WOces+nZDamYh3V/dqTQ6kUS9hK0EDYOr58VRSjeRbLCYXirkGovXBoXbRmQgamOA5USYPpilvDFLW+qbqpu9EsqXtAPiRIX+BMkM2vSGyKALpf0zI0s36iMDDGCwiklZITcQm8WW1WwPmvWOMdkkGkyKX+Qa4KTDCNAeaJwF6PvJSHkso9VKPyc/t/ALbuj69+q1tGxVmmEmLQrCYFyxSKgX4n99j3ZbONQZGlHytgIap5VQq2J2zaumkztY2HIBbRkOOKBNAbvwaF8qeaG7BMrCTeAuUsJK5DTxhejJwJUPiEwJJ6zjzt1XifnILijld1VCggHcI2Fg4yFBlCGwGMb6sFeOmpzIXUdi7UNbuUJO3hzPVfscQaKDMl+cksuXSP5kCuhBbFmGjnsrZ5oNrtYeWPDFpOj7m5OfWFU6kmbrB7I5Gqsy8cFzmIiw/4T6OibF4RhbLhCpQntM1hpgt3kvSbPTpgbvg6ov/jh3FypmWB1UOitZDBiS9bMCHouMJskbHCkXLSeto9JIY4Dk2m/GBBJ8Q4L9rCOWex9ATZismE9IHL59646coqJ0tk7GO7unQ0bGTQgJ5PcVYS7IsPJUDK/UBkFwjsgVoBNjrnWvJ2yamtG/XDbywBzIzEfiGvTcLCQI4Oe/oA2NvAInyK5ZRwKFQ0yYt2MxTiIbLbvMH1XqA4KWLV97u+f01mbypDbYJupjw0u8exdjtZ7ia9knYtosBesoihD9A== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e9a9cf8c-4c52-48de-927c-08d9e583d109 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:36.1115 (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 13/69] avcodec/msmpeg4.h: Move encoder-only stuff 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: Go6x8ZRdVnRI Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegvideo_enc.c | 2 +- libavcodec/msmpeg4.h | 15 ------------- libavcodec/msmpeg4enc.c | 1 + libavcodec/msmpeg4enc.h | 45 ++++++++++++++++++++++++++++++++++++++ libavcodec/wmv2enc.c | 1 + 5 files changed, 48 insertions(+), 16 deletions(-) create mode 100644 libavcodec/msmpeg4enc.h diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index d2365a54af..07dc575a5b 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -56,7 +56,7 @@ #include "mpegutils.h" #include "mjpegenc.h" #include "speedhqenc.h" -#include "msmpeg4.h" +#include "msmpeg4enc.h" #include "pixblockdsp.h" #include "qpeldsp.h" #include "faandct.h" diff --git a/libavcodec/msmpeg4.h b/libavcodec/msmpeg4.h index 483c965b9d..dbe650cbbc 100644 --- a/libavcodec/msmpeg4.h +++ b/libavcodec/msmpeg4.h @@ -28,7 +28,6 @@ #include "avcodec.h" #include "mpegvideo.h" #include "msmpeg4data.h" -#include "put_bits.h" #define INTER_INTRA_VLC_BITS 3 #define MB_NON_INTRA_VLC_BITS 9 @@ -42,20 +41,10 @@ extern VLC ff_mb_non_intra_vlc[4]; extern VLC ff_inter_intra_vlc; -void ff_msmpeg4_code012(PutBitContext *pb, int n); void ff_msmpeg4_common_init(MpegEncContext *s); -void ff_msmpeg4_encode_block(MpegEncContext * s, int16_t * block, int n); -void ff_msmpeg4_handle_slices(MpegEncContext *s); -void ff_msmpeg4_encode_motion(MpegEncContext * s, int mx, int my); int ff_msmpeg4_coded_block_pred(MpegEncContext * s, int n, uint8_t **coded_block_ptr); -void ff_msmpeg4_encode_init(MpegEncContext *s); -void ff_msmpeg4_encode_picture_header(MpegEncContext *s, int picture_number); -void ff_msmpeg4_encode_ext_header(MpegEncContext *s); -void ff_msmpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64], - int motion_x, int motion_y); - 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); @@ -72,9 +61,5 @@ int ff_msmpeg4_pred_dc(MpegEncContext *s, int n, CONFIG_WMV1_DECODER || \ CONFIG_WMV2_DECODER || \ CONFIG_VC1_DECODER) -#define CONFIG_MSMPEG4_ENCODER (CONFIG_MSMPEG4V2_ENCODER || \ - CONFIG_MSMPEG4V3_ENCODER || \ - CONFIG_WMV1_ENCODER || \ - CONFIG_WMV2_ENCODER) #endif /* AVCODEC_MSMPEG4_H */ diff --git a/libavcodec/msmpeg4enc.c b/libavcodec/msmpeg4enc.c index 2c619e1210..31920b7f0d 100644 --- a/libavcodec/msmpeg4enc.c +++ b/libavcodec/msmpeg4enc.c @@ -39,6 +39,7 @@ #include "mpeg4video.h" #include "msmpeg4.h" #include "msmpeg4data.h" +#include "msmpeg4enc.h" #include "put_bits.h" #include "rl.h" #include "vc1data.h" diff --git a/libavcodec/msmpeg4enc.h b/libavcodec/msmpeg4enc.h new file mode 100644 index 0000000000..12f8f44232 --- /dev/null +++ b/libavcodec/msmpeg4enc.h @@ -0,0 +1,45 @@ +/* + * MSMPEG4 encoder 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_MSMPEG4ENC_H +#define AVCODEC_MSMPEG4ENC_H + +#include "config.h" +#include "mpegvideo.h" +#include "put_bits.h" + +void ff_msmpeg4_encode_init(MpegEncContext *s); +void ff_msmpeg4_encode_picture_header(MpegEncContext *s, int picture_number); +void ff_msmpeg4_encode_ext_header(MpegEncContext *s); +void ff_msmpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64], + int motion_x, int motion_y); +void ff_msmpeg4_encode_block(MpegEncContext * s, int16_t * block, int n); +void ff_msmpeg4_handle_slices(MpegEncContext *s); +void ff_msmpeg4_encode_motion(MpegEncContext * s, int mx, int my); + +void ff_msmpeg4_code012(PutBitContext *pb, int n); + +#define CONFIG_MSMPEG4_ENCODER (CONFIG_MSMPEG4V2_ENCODER || \ + CONFIG_MSMPEG4V3_ENCODER || \ + CONFIG_WMV1_ENCODER || \ + CONFIG_WMV2_ENCODER) + +#endif diff --git a/libavcodec/wmv2enc.c b/libavcodec/wmv2enc.c index 5cb4c4073c..2622f833b0 100644 --- a/libavcodec/wmv2enc.c +++ b/libavcodec/wmv2enc.c @@ -22,6 +22,7 @@ #include "h263.h" #include "mpegvideo.h" #include "msmpeg4.h" +#include "msmpeg4enc.h" #include "msmpeg4data.h" #include "wmv2.h" #include "wmv2enc.h"