From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id C6995408C8 for ; Tue, 1 Feb 2022 13:10:46 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C7F2168B323; Tue, 1 Feb 2022 15:07:48 +0200 (EET) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2064.outbound.protection.outlook.com [40.92.89.64]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E596C68B2FA 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=ndD1FLLaeYimRAGr/8ZuZzox1Yulir5qIJ9AGnjzEF8PA9u3PX32uBAuJogdYSuOfaao7s/i0wDWOeF8rlQojr3qCAxoMd99egYh2YjAiODP2LptgzwO6IYz65TpnYmYRCyz8QvKX5CaNRJi5H780jPnSvfBqcTRQ2KN+DHreRK/C/Xsf9C63HXbN0xCIJeu2e1IwduJgB4SpoldgRKEX7zyW8Qs4N9LT6zlGJaDAZ0Tx59n0vec1UWX+jot2OniAI6q8/2fxmGZH3D2gansaJ5jRgCnTPF8NOfuOiGJV9B10eZDxn74wreaaJY9O6XmWg6BKE8sXrm1wr7DqC2hmg== 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=N1AgVmChjsmsKNZdaAXCxekFeMSOv/nm+Phec5drUD8=; b=c2ZcDCiS8IqZf43nITqM6Hd20FLjDGiFRRHnEfDNGnE6UreHuBQjN9J/iwIl2jKHGdOB8MnV1eMtvdaWVKp3umuxuBf+xreNfnB6T4fn1HGKU+LTmePsG8ZezyOFkx4LbAE42lxHPAl8FknuTxDEFyvMAlrQhUD4sgkNF264fUVWussTE797SR5CT9peYFllT1D3L/8+UD+WDHmylFM4weF94XjUM6MFFArpEfqdJiaqf1BKKCaoArTVNdzXUWqBNTgrORosKL2lvMi29lwlaFZSev4XAWeHULZHJwmbMpOrxsRr17EQR0f0BLVjmTO4uCOf/tEjlweUsXWj6TIzEA== 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=N1AgVmChjsmsKNZdaAXCxekFeMSOv/nm+Phec5drUD8=; b=KUCp2+XmlnQov9L96rFZruluJb6zLIHeeHGnFDWjO/wIX+2/Il0mmBj4maq8s8p4DHD6AQjfGfZpUvViFCD56ONhmEDDR4QGE2BIF5c3HN+wFBz+/FZaeZoIXz/b/v6haUL8pAMITS5f18Vy175tKnzAcnKOqeFQysuMOZ8Yo4DweeKbl2aTdAfydR/WbRYeFz3s7x8HLIMiUMuzmvcG2iT5Cc2AE1LbUCjPes5WkBYbhXauTHsQ0rG/CC8HIN7IZhOA5bmvInwXycYNsQ3RHp1rU/2f8NckuPQd3Si/bB8hEwtAFz5lBRp7icTXrQfiCGPnHBtcmJM/8tZkm32r1A== 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:41 +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:41 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Feb 2022 14:06:14 +0100 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [3s+x0v4QVGhOv1PDs7uVjDprvDqdPG9T] 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-16-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b887adca-0158-4445-d9c7-08d9e583d3f8 X-MS-TrafficTypeDiagnostic: AM0PR03MB5700:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ONLjpp7VKemW83HcCO05rwfGyfCEf0MfA9or5TIMqtctsHN8tQZOdiQSiX5QsetgyKKlY1Hd/Spy0hjZhOyQGKX7EaBVl8aBC8scbYtAT9WJMSMPxHkaVolDsP1nrfIa73gP+UbMcoq7BjyAlIfE6yXbHhGLBLic/yu0+LfxGxIQF48Ug67baLr6QkCxWSvUSdhez5RaSh9AGG9LB6keaFuDLNmgJL7yZvY+CvgdHqHw3qdyjABz7Rdw77fW+dE4Jxn4S4jQlwTOySq9u2rMgZUWrQ9PCwVwWyelbM8YlN16peupz82AocVHurODHLZWFqDY0ifbYHy6q5WPrb1HFBYapcQfdhX+9BjtWvHb8rXY/pX/Sy9iGw5mpjRRgjgz761craKB/OHPpDVglHyqtW5yH14JRlEA+uFwc8zvN0at2RGwq+vjM4VmslPU3mG/VJrRPQIs/fmCxiQDNfhBu0SNqzaOdvpMx0fSczNyxa8LAf43jRLo2EOKazTPjTGVfzcU7udlSt9F5eFVa2LkqSYKCpU3l9B7PYIvLWYFhgTB9WmaMd/ppngdTkCl/pHn X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?SVl4MnzDDgacACc5XB7LTFPfxh9PxdC2fnO3yVzeFZOuzEuhaKXtrcmAfB6P?= =?us-ascii?Q?LeBltjek8IAtorMzmaBr2jxn578mRnct8aC5rxcpPpz+rA04hS4y1BAbf3O1?= =?us-ascii?Q?NmHi2TAbsS2tjjLwwQs3A0HR/Tv/aGEC8dxVKU1r6B1h9rOT8aZTFRvZY1Ut?= =?us-ascii?Q?/Nz0m9culgoR5JgxK+9ayTeEfsaxINyuAEtt7/tk3eOxfavIytZ6orHfS4Yi?= =?us-ascii?Q?yjh1R3pu8aveG58Qbgf/B6i5Nn7izogF4okjGpuPWL46fdTWF1HtRb6Or6dA?= =?us-ascii?Q?evoi5poWzfdBD35SfggHn99bGrskHSi0bfMynH44VdlIqruPSeahD/Mn/OXL?= =?us-ascii?Q?K7b7qKDt1GjrHdP1Vs4yUx6siuaEq4S/R/74rr8KW+DhPItmW0iIRbrRHR36?= =?us-ascii?Q?aM/OUksRHx/SFaeEoPsLWLDnPFvsZbnF/YBSXvei1Kr22GVBcrCJ6pQ28xH9?= =?us-ascii?Q?JNy4h4sxT/hiFxoHRk/MMvzqeg5RJqxeL2zuRt1YQkZ69qHr26MITOk3OWUT?= =?us-ascii?Q?DywaybLZmze3/HKpoP3RV0GkE46lgDgSXWCzAMJOYxDn8r7XEd3oqG+gvd+W?= =?us-ascii?Q?JLBmphbVuohDd1sOz3Y8HRml1VTNv97SUI9Ja6TDF8jDQCFPZ1+Bs9osT7aW?= =?us-ascii?Q?i9Mxup27f+ijjTiwFaqfFUjEoKlEDrfyGPbhbhzAwwx2an7E/vpRiyuPGlLZ?= =?us-ascii?Q?5ziL/PZJKVMuVmpakGcAHU0qwCnXIJZFLBwVTrddtEtx8eEmgnLoiZ9QgKRe?= =?us-ascii?Q?yiJO0pRSt84eufVUZkdRo5TgfAI6FtJ4fV+fwIz9xxqPMoz70Ev4otq2Cgus?= =?us-ascii?Q?pGfHPAAZ8In4oIrXF2s/bLv4A4YUPvuSP32KmeujMcvu5BUiEXm/NXH47HoS?= =?us-ascii?Q?jNq8CSyT5zMRkhoid9N7ZtRqol+pD6b1MqXWE9xXknyNuvgrd+nZRuor4g9s?= =?us-ascii?Q?P4CrIfkGHJGTl4MsyqSasg=3D=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b887adca-0158-4445-d9c7-08d9e583d3f8 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:41.0663 (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 17/69] avcodec/mpeg4video.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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Signed-off-by: Andreas Rheinhardt --- libavcodec/h263dec.c | 1 + libavcodec/ituh263dec.c | 1 + libavcodec/mpeg4video.h | 66 ----------------------- libavcodec/mpeg4video_parser.c | 1 + libavcodec/mpeg4videodec.c | 1 + libavcodec/mpeg4videodec.h | 99 ++++++++++++++++++++++++++++++++++ libavcodec/mpegvideo.c | 2 +- libavcodec/msmpeg4dec.c | 2 +- libavcodec/nvdec_mpeg4.c | 1 + libavcodec/vaapi_mpeg4.c | 2 +- libavcodec/vdpau_mpeg4.c | 2 +- 11 files changed, 108 insertions(+), 70 deletions(-) create mode 100644 libavcodec/mpeg4videodec.h diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 5a54d57bbc..99dc7a74d2 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -41,6 +41,7 @@ #include "internal.h" #include "mpeg_er.h" #include "mpeg4video.h" +#include "mpeg4videodec.h" #if FF_API_FLAG_TRUNCATED #include "mpeg4video_parser.h" #endif diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c index 7d7a1f01a2..b09cc9a2db 100644 --- a/libavcodec/ituh263dec.c +++ b/libavcodec/ituh263dec.c @@ -48,6 +48,7 @@ #include "rv10.h" #include "mpeg4video.h" #include "mpegvideodata.h" +#include "mpeg4videodec.h" // The defines below define the number of bits that are read at once for // reading vlc values. Changing these may improve speed and data cache needs diff --git a/libavcodec/mpeg4video.h b/libavcodec/mpeg4video.h index 14fc5e1396..bee52b2c29 100644 --- a/libavcodec/mpeg4video.h +++ b/libavcodec/mpeg4video.h @@ -70,86 +70,20 @@ /* smaller packets likely don't contain a real frame */ #define MAX_NVOP_SIZE 19 -typedef struct Mpeg4DecContext { - MpegEncContext m; - - /// number of bits to represent the fractional part of time - int time_increment_bits; - int shape; - int vol_sprite_usage; - int sprite_brightness_change; - int num_sprite_warping_points; - /// sprite trajectory points - uint16_t sprite_traj[4][2]; - /// sprite shift [isChroma] - int sprite_shift[2]; - - // reversible vlc - int rvlc; - /// could this stream contain resync markers - int resync_marker; - /// time distance of first I -> B, used for interlaced B-frames - int t_frame; - - int new_pred; - int enhancement_type; - int scalability; - - /// QP above which the ac VLC should be used for intra dc - int intra_dc_threshold; - - /* bug workarounds */ - int divx_version; - int divx_build; - int xvid_build; - int lavc_build; - - int vo_type; - - /// flag for having shown the warning about invalid Divx B-frames - int showed_packed_warning; - /** does the stream contain the low_delay flag, - * used to work around buggy encoders. */ - int vol_control_parameters; - int cplx_estimation_trash_i; - int cplx_estimation_trash_p; - int cplx_estimation_trash_b; - - int rgb; - - int32_t block32[12][64]; - // 0 = DCT, 1 = DPCM top to bottom scan, -1 = DPCM bottom to top scan - int dpcm_direction; - int16_t dpcm_macroblock[3][256]; -} Mpeg4DecContext; - - -void ff_mpeg4_decode_studio(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, - uint8_t *dest_cr, int block_size, int uvlinesize, - int dct_linesize, int dct_offset); void ff_mpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64], int motion_x, int motion_y); -void ff_mpeg4_pred_ac(MpegEncContext *s, int16_t *block, int n, - int dir); void ff_set_mpeg4_time(MpegEncContext *s); int ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number); -int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb, - int header, int parse_only); void ff_mpeg4_encode_video_packet_header(MpegEncContext *s); void ff_mpeg4_clean_buffers(MpegEncContext *s); void ff_mpeg4_stuffing(PutBitContext *pbc); void ff_mpeg4_init_partitions(MpegEncContext *s); void ff_mpeg4_merge_partitions(MpegEncContext *s); void ff_clean_mpeg4_qscales(MpegEncContext *s); -int ff_mpeg4_decode_partitions(Mpeg4DecContext *ctx); int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s); -int ff_mpeg4_decode_video_packet_header(Mpeg4DecContext *ctx); -int ff_mpeg4_decode_studio_slice_header(Mpeg4DecContext *ctx); void ff_mpeg4_init_direct_mv(MpegEncContext *s); -int ff_mpeg4_workaround_bugs(AVCodecContext *avctx); -int ff_mpeg4_frame_end(AVCodecContext *avctx, const uint8_t *buf, int buf_size); /** * @return the mb_type diff --git a/libavcodec/mpeg4video_parser.c b/libavcodec/mpeg4video_parser.c index 1f89bae490..3d0d0e4714 100644 --- a/libavcodec/mpeg4video_parser.c +++ b/libavcodec/mpeg4video_parser.c @@ -26,6 +26,7 @@ #include "parser.h" #include "mpegvideo.h" #include "mpeg4video.h" +#include "mpeg4videodec.h" #if FF_API_FLAG_TRUNCATED /* Nuke this header when removing FF_API_FLAG_TRUNCATED */ #include "mpeg4video_parser.h" diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index c0eaa00eba..a437f233ec 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -35,6 +35,7 @@ #include "mpegvideodata.h" #include "mpeg4video.h" #include "mpeg4videodata.h" +#include "mpeg4videodec.h" #include "h263.h" #include "h263data.h" #include "h263dec.h" diff --git a/libavcodec/mpeg4videodec.h b/libavcodec/mpeg4videodec.h new file mode 100644 index 0000000000..65d846aed0 --- /dev/null +++ b/libavcodec/mpeg4videodec.h @@ -0,0 +1,99 @@ +/* + * MPEG-4 decoder internal header. + * Copyright (c) 2000,2001 Fabrice Bellard + * Copyright (c) 2002-2010 Michael Niedermayer + * + * 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_MPEG4VIDEODEC_H +#define AVCODEC_MPEG4VIDEODEC_H + +#include + +#include "get_bits.h" +#include "mpegvideo.h" + + +typedef struct Mpeg4DecContext { + MpegEncContext m; + + /// number of bits to represent the fractional part of time + int time_increment_bits; + int shape; + int vol_sprite_usage; + int sprite_brightness_change; + int num_sprite_warping_points; + /// sprite trajectory points + uint16_t sprite_traj[4][2]; + /// sprite shift [isChroma] + int sprite_shift[2]; + + // reversible vlc + int rvlc; + /// could this stream contain resync markers + int resync_marker; + /// time distance of first I -> B, used for interlaced B-frames + int t_frame; + + int new_pred; + int enhancement_type; + int scalability; + + /// QP above which the ac VLC should be used for intra dc + int intra_dc_threshold; + + /* bug workarounds */ + int divx_version; + int divx_build; + int xvid_build; + int lavc_build; + + int vo_type; + + /// flag for having shown the warning about invalid Divx B-frames + int showed_packed_warning; + /** does the stream contain the low_delay flag, + * used to work around buggy encoders. */ + int vol_control_parameters; + int cplx_estimation_trash_i; + int cplx_estimation_trash_p; + int cplx_estimation_trash_b; + + int rgb; + + int32_t block32[12][64]; + // 0 = DCT, 1 = DPCM top to bottom scan, -1 = DPCM bottom to top scan + int dpcm_direction; + int16_t dpcm_macroblock[3][256]; +} Mpeg4DecContext; + +int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb, + int header, int parse_only); +void ff_mpeg4_decode_studio(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, + uint8_t *dest_cr, int block_size, int uvlinesize, + int dct_linesize, int dct_offset); +int ff_mpeg4_decode_partitions(Mpeg4DecContext *ctx); +int ff_mpeg4_decode_video_packet_header(Mpeg4DecContext *ctx); +int ff_mpeg4_decode_studio_slice_header(Mpeg4DecContext *ctx); +int ff_mpeg4_workaround_bugs(AVCodecContext *avctx); +void ff_mpeg4_pred_ac(MpegEncContext *s, int16_t *block, int n, + int dir); +int ff_mpeg4_frame_end(AVCodecContext *avctx, const uint8_t *buf, int buf_size); + + +#endif diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 0e0f035526..c39cf12c40 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -40,7 +40,7 @@ #include "mpeg_er.h" #include "mpegutils.h" #include "mpegvideo.h" -#include "mpeg4video.h" +#include "mpeg4videodec.h" #include "mpegvideodata.h" #include "qpeldsp.h" #include "thread.h" diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c index 08abece9ec..bc96b86507 100644 --- a/libavcodec/msmpeg4dec.c +++ b/libavcodec/msmpeg4dec.c @@ -32,7 +32,7 @@ #include "h263.h" #include "h263data.h" #include "h263dec.h" -#include "mpeg4video.h" +#include "mpeg4videodec.h" #include "msmpeg4data.h" #include "vc1data.h" #include "wmv2dec.h" diff --git a/libavcodec/nvdec_mpeg4.c b/libavcodec/nvdec_mpeg4.c index 739b049933..a134423382 100644 --- a/libavcodec/nvdec_mpeg4.c +++ b/libavcodec/nvdec_mpeg4.c @@ -22,6 +22,7 @@ #include "avcodec.h" #include "mpeg4video.h" +#include "mpeg4videodec.h" #include "nvdec.h" #include "decode.h" diff --git a/libavcodec/vaapi_mpeg4.c b/libavcodec/vaapi_mpeg4.c index 71e155154c..6800499c85 100644 --- a/libavcodec/vaapi_mpeg4.c +++ b/libavcodec/vaapi_mpeg4.c @@ -23,7 +23,7 @@ #include "h263.h" #include "hwconfig.h" #include "internal.h" -#include "mpeg4video.h" +#include "mpeg4videodec.h" #include "mpegvideo.h" #include "vaapi_decode.h" diff --git a/libavcodec/vdpau_mpeg4.c b/libavcodec/vdpau_mpeg4.c index 93b25beb1f..6e082eefc6 100644 --- a/libavcodec/vdpau_mpeg4.c +++ b/libavcodec/vdpau_mpeg4.c @@ -25,7 +25,7 @@ #include "avcodec.h" #include "hwconfig.h" -#include "mpeg4video.h" +#include "mpeg4videodec.h" #include "vdpau.h" #include "vdpau_internal.h" -- 2.32.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".