From patchwork Tue Feb 1 13:06:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 33995 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2c4e:0:0:0:0 with SMTP id x14csp604139iov; Tue, 1 Feb 2022 05:11:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFwRtPI29hCoowIpTOKE2nSqMakSS8h1/Zghs75ILd6BpYU/qdNbRzubJcm4ryLE6JC9Qn X-Received: by 2002:a50:e616:: with SMTP id y22mr25062627edm.277.1643721107451; Tue, 01 Feb 2022 05:11:47 -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 qk33si5989988ejc.636.2022.02.01.05.11.46; Tue, 01 Feb 2022 05:11:47 -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=BKxgoIye; 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 D803A68B33F; Tue, 1 Feb 2022 15:07:52 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2032.outbound.protection.outlook.com [40.92.89.32]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4DA5068B319 for ; Tue, 1 Feb 2022 15:07:47 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g25gswNbgHz88g/iu8INZrGyrRycy8Tuln92pfy4jlR3NstcZCvsjqvYbfLdGIrNnFj254K2uQaf0Jb+vkMpDbKMyLPfc09P3Byh4KW1Q7j71BBa7ui/vRF05uwDAm30O/K1RblirsX+vIquxJJ4zd0D36hDvhY9nnwzuA72MuybV/ukLie+0Bdamlj5W9UueKPS3Iww7HPFnQEf3X9AMlp68EKOCRrq6GNMEgsVcLXyWRAzbsDIwloQJG9LqTThqSqF9tweZSSjYNi7xy9zhAJosU16jh9HakMBjyab8aVKxUSPnD4hOUnxaB+wbacwzTEiv9t5fT2DSU0nJLJrHw== 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=Qz0oReIxFswJKZqhKcxgyVYwmdi1PhQRNlnuy+HJRPU=; b=LoSzN7xN+UsTHHIQTb67Ixk1nuDijIyyy23D+b2lq/ipDB7INepfIa7mKltpmPAcN5Wx4zP8MKYA7j+w1uqsZQvKImunPG+hJpNEfA50jVnXhKVb+3VZZsbS9yqtzix3r1puOpaF56nK8Ao4aDLsI1NlYAhYgljhoDzMIt2aKHv2uPN8FxHglezZ3hpWmZHpEGLZHuuK46UpBxS1CearABskwMbtx08NTR/UiAWS/KzX+TM7tTyS1G63v0NiDqHVy0jg6vEnbZOMlTLd/hRm5uc1sNZXH/uYhm7ltcQ/C/eJGWtfQ1Fi2qZHFs757g/MPVYb+AVrmCQVsoLjsYXRkQ== 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=Qz0oReIxFswJKZqhKcxgyVYwmdi1PhQRNlnuy+HJRPU=; b=BKxgoIyeZyoX6dnkN8dHHMpwPEvScTeC6UbLzWjM13WOyvXpdk48s5g470EqyHU0nTSMbOchHZZhIngiiGnYXrZpxmPA8fGIhvzNDgk7IF4XPLLAIr/isKEeLKMRpEkn2pAqMPMDk9kSYx3k5Ao33HIvFV+k0Dd4nUy832KO/wMrJNUoKT3ow2reudA277M3Fr5Pp6PauXxjXHQqR6jkFKuccM12ZHWQtkJPoPIWTT1DWAqrkwpIHPyqHMNvervCZKgKmdMB58d0bDo/pj7q96MCuuN+NkaA8AYhu/X+tUFQS6zyfJiXYF6RN2bDKVlftdpjp5iFZJtZyah7l8bQvg== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM0PR03MB5700.eurprd03.prod.outlook.com (2603:10a6:208:16f::32) 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:45 +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:45 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Feb 2022 14:06:18 +0100 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [z7a2WIvc55w/Zvj1uzh8dM/3Ln5yx04l] 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-20-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4726b35d-24e1-4718-8f44-08d9e583d6cb X-MS-TrafficTypeDiagnostic: AM0PR03MB5700:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3BNomvT2Oy7CZ4T04no8kNDH9eXz/tRBFTGMutWD6KUxCLuM+2M5Whqb3EioXq/puXhphdGyNID65+rsbCBNrz2EOMM5NuHGHkdF/as5VloVtDcDCpPVQ3pIucDMo7hY/U32KTI0HetZvwZG+hU5B30faZrWkGK9yt3yrx4+eoCaO6MmbgK2IUYw9oH8hVAnddVSRNA0byzWOaG4cC2jW7p8CO/1lPXu9Pmn42kxevcUELFzvDxumgPLY9CS38uuya1655S8V+tf6ca7H8VVnmX8CMbBe8I1YtSRdfGQ1P0yX5d1CBCBeNfOfI4sdyKS7upjgCHUPXIX03r7H+qghfpOZiP1gLnoIjT0QWD8MWf7NMYy4+kmsiRnZ5PnCvxfeLwsD8f7atAE2faeXSMNhnJaKiMiSJ1L160kY/2exFlbDKdFXhW7+uIFrD9Zflg+4aLmHUgW6h+XYPp8MsErCaBmIQyv9vsPIGj39A0xmBo6kGAwa2stKIQLbFdzJOvCqdxgKIWaagvmFKlAdVI+MqY229L+apu8WLFN66axPmpq6ziV0UuY+HcG1QYQPHhH X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: h5shb6HTKbJHlCVT8cP9zQp1H3zAkGiUKsFTzdLDEDmn33ZdOYMnlH7REVLOF2l8tF0PnFa9e6b/BeEU+XhpXINJBO7CSDZwNgXi3hBAn+yWGiEq3GuQEiOcmMp25uc9N+rix0dq8EtDz/k81lqkzVQoPJgRe+22e+VB5kNLMvdJSA/ck1Xilc5FXBfI/N5t96dqqNQTxqXw+6LsT+dMWzBeyJV+dNH7KF9HuuXnxZ1K8IkEiPXDElsomEAMn7t5WOLp7IkIgtNnrViKE1OgM90UjjCiqElxroptber5JZERR/JPaC+f1SDNUJlNYv5NOVXFFsfQraVKfKeKBLp2JEV55TTdwlwRQ67GXioc2e6AFBGf19vg7mfosSflXyBO9JYKUcYLie12mU0nmYT0cqnyo2xjbmJIs5jODea/nzjRMz7YxdzDNohR4dUSmxRVblwX/qKtr8su4co7sPOQfQRFJG0FPr9NWVcpMkLv1QQgvqXACOKNbvwBgQD6WD/8qMNQchFf34QABacbPouWMFo8bKQOo09bIW0GQdRhAp3zZWbb4aTAz7f3nDtU2cmWfZJnPU5L35uZkqFPamMR6kPKXK94CoqPvetCKLUtIxWiBiInpfb6YxSQ961OaL05EaYsXYzu7rwAEPzw36aJ2OEaPIggOsEgl9eSSqB7YM/9BkxJZtAPySK1iv/YE78BWRJiCVih3+uprxK1XlXBvJsm23Lui7mecVUFt8ae9ySeoiWB3RumbjW8DnsM5hIiYT8Idv36Ma7P25saXsy73qQ73xLEYzBIZFWYGAukCgJln4wJCQyK3U6EIDpIDAMwtR39/v66Ja4pgXYLFWKmSUOmNl40UIN1eP6tfcLKvDqIUvo/WAzeAWKBhj39qVkMPmw9uxicQt0tl+ztlxzft++IQxYH396SKCevqcjggkqS13bvJEw9uhWdl4xo94wtD3p9VEq1VMs7YNVqsa9HpA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4726b35d-24e1-4718-8f44-08d9e583d6cb 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:45.8039 (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: AM0PR03MB5700 Subject: [FFmpeg-devel] [PATCH v2 21/69] avcodec/mpeg12.h: Move encoder-only stuff into 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: uoH0EUENccgs Signed-off-by: Andreas Rheinhardt --- libavcodec/mpeg12.h | 8 -------- libavcodec/mpeg12enc.c | 2 +- libavcodec/mpeg12enc.h | 38 ++++++++++++++++++++++++++++++++++++++ libavcodec/mpegvideo_enc.c | 1 + libavcodec/speedhqenc.c | 3 +-- 5 files changed, 41 insertions(+), 11 deletions(-) create mode 100644 libavcodec/mpeg12enc.h diff --git a/libavcodec/mpeg12.h b/libavcodec/mpeg12.h index a405db6c2d..e0406b32d9 100644 --- a/libavcodec/mpeg12.h +++ b/libavcodec/mpeg12.h @@ -36,19 +36,11 @@ void ff_mpeg12_common_init(MpegEncContext *s); -void ff_mpeg1_init_uni_ac_vlc(const RLTable *rl, uint8_t *uni_ac_vlc_len); - void ff_mpeg1_clean_buffers(MpegEncContext *s); #if FF_API_FLAG_TRUNCATED int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size, AVCodecParserContext *s); #endif -void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number); -void ff_mpeg1_encode_mb(MpegEncContext *s, int16_t block[8][64], - int motion_x, int motion_y); -void ff_mpeg1_encode_init(MpegEncContext *s); -void ff_mpeg1_encode_slice_header(MpegEncContext *s); - void ff_mpeg12_find_best_frame_rate(AVRational frame_rate, int *code, int *ext_n, int *ext_d, int nonstandard); diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index 9c0be69ded..3acb82ac9d 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -37,10 +37,10 @@ #include "libavutil/stereo3d.h" #include "avcodec.h" -#include "bytestream.h" #include "mathops.h" #include "mpeg12.h" #include "mpeg12data.h" +#include "mpeg12enc.h" #include "mpegutils.h" #include "mpegvideo.h" #include "profiles.h" diff --git a/libavcodec/mpeg12enc.h b/libavcodec/mpeg12enc.h new file mode 100644 index 0000000000..fbbc43f891 --- /dev/null +++ b/libavcodec/mpeg12enc.h @@ -0,0 +1,38 @@ +/* + * MPEG-1/2 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_MPEG12ENC_H +#define AVCODEC_MPEG12ENC_H + +#include + +#include "mpegvideo.h" +#include "rl.h" + +void ff_mpeg1_init_uni_ac_vlc(const RLTable *rl, uint8_t *uni_ac_vlc_len); + +void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number); +void ff_mpeg1_encode_mb(MpegEncContext *s, int16_t block[8][64], + int motion_x, int motion_y); +void ff_mpeg1_encode_init(MpegEncContext *s); +void ff_mpeg1_encode_slice_header(MpegEncContext *s); + +#endif /* AVCODEC_MPEG12ENC_H */ diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 7c5d013200..aaa1488977 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -46,6 +46,7 @@ #include "idctdsp.h" #include "mpeg12.h" #include "mpeg12data.h" +#include "mpeg12enc.h" #include "mpegvideo.h" #include "mpegvideodata.h" #include "h261enc.h" diff --git a/libavcodec/speedhqenc.c b/libavcodec/speedhqenc.c index 6df0316611..2a310a6c4f 100644 --- a/libavcodec/speedhqenc.c +++ b/libavcodec/speedhqenc.c @@ -27,12 +27,11 @@ * SpeedHQ encoder. */ -#include "libavutil/pixdesc.h" #include "libavutil/thread.h" #include "avcodec.h" -#include "mpeg12.h" #include "mpeg12data.h" +#include "mpeg12enc.h" #include "mpegvideo.h" #include "speedhqenc.h"