Message ID | AM7PR03MB666035632BD7A42C14670F0B8F269@AM7PR03MB6660.eurprd03.prod.outlook.com |
---|---|
State | New |
Headers | show
Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2c4e:0:0:0:0 with SMTP id x14csp605078iov; Tue, 1 Feb 2022 05:12:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+MGEz8heMurHBRutW4J80X05eB0I8+27Gm61Zj4h4GfDOHrwkbLxzORRgMAb0a7fZO/N5 X-Received: by 2002:a17:906:5d09:: with SMTP id g9mr20405711ejt.510.1643721174695; Tue, 01 Feb 2022 05:12:54 -0800 (PST) Return-Path: <ffmpeg-devel-bounces@ffmpeg.org> Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g15si9382988eds.333.2022.02.01.05.12.54; Tue, 01 Feb 2022 05:12:54 -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=hnjVcc4d; 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 D116568B2F9; Tue, 1 Feb 2022 15:07:56 +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-db8eur05olkn2084.outbound.protection.outlook.com [40.92.89.84]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 73A8568B33E for <ffmpeg-devel@ffmpeg.org>; Tue, 1 Feb 2022 15:07:52 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nzyx2dflk00uXC3N52rVMvRqMG7fQZDioVssRf0v54SpphsukdLQ8MAJ08hc1qqR62vWBW786U/n1+m006I48k9iYeG/iDlVhl7U/HWbyHm4xyXtvoKFjjWeHz+xyqwmw5UixHfDeuK/0ZEW3xu0rchf06TeLry1mPmkPzaJn1osIqEbbXRagOS8mC+cFCHKW35Vg+5d6RLf5Y83ywYPOc6+VOAMlDgdrX18lrgjob9aVzr6pNWK/pspfVZ+QKLsY6wY/W+vWIvTitFjwDOt/BAbMt7mYiOyA9kviFiKH7GnHwXllySRFc007nFEQKt1/qQ8xEhDaFDUrZ7+bK8SeQ== 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=j+vE5s5+u577hePKlWNaoqxCcVj6aKRFgpWgoGeI8hI=; b=aDQVSfJyLMBjBTdWw6iGliEgtJYVM+qR40hVjKoEJIiYOZz3uRP2M/v2/xXz4cJzGdh3t7ubiCFoCSIfTUa1qD6nOqET41QRG5QiYkpV+MK55i69clOI+DSwJDbTPuR8QnJF0sJtUF5fv4hz+DtcdsnWctxvH0Z0CjbgJY10WVoH9fozqV6TMMSd23GMFzUYIn5vIIBNB7NMWc4ZqeeNcThNa/DzwP8k5YDv42jhlhEVK/QXGs7G3JskfrSvWcA0QAFSU/BjTWox1is5LPB0eJ369XsQiddDYRNvxsyabQ8d5xB1l7D2sNw874l5d+J1Dj0ppE0IkftW1Qy20aRmVQ== 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=j+vE5s5+u577hePKlWNaoqxCcVj6aKRFgpWgoGeI8hI=; b=hnjVcc4dqIO/Lxb/S/y6pK3mECBJxVbEsWSChWaYhfIT9JaU1pfv+G0R1OmGOQLmvz9ORIsZSJZKOvAtNrjUjDx57Vrr6V3R3yLqByQ+OJ64JEt8uy+7HvApNadImmBvL6vSTbDrRretm3fO6sJ0Bla2lxOpQzBl6Fe6pTq6wxHpSsRsJEG2/50AbG3YquU3aewhU58W3TY1e9HOTBkQgGz/oeaoeZmi9P/2CPGLDL3MW7ZzhnuMoiZJi3ppEXhpLDXiVKOHJlCB7jic+jaz/9qmaKn0NGwzz+K7n/nZNULsY6u/glZcSo4uyDUuKRzLgCBYSkvyj6gL3f6Q0R7VuA== 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:51 +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:51 +0000 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Feb 2022 14:06:22 +0100 Message-ID: <AM7PR03MB666035632BD7A42C14670F0B8F269@AM7PR03MB6660.eurprd03.prod.outlook.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <AM7PR03MB666068F62BC40F2C6EAC1C658F269@AM7PR03MB6660.eurprd03.prod.outlook.com> References: <AM7PR03MB666068F62BC40F2C6EAC1C658F269@AM7PR03MB6660.eurprd03.prod.outlook.com> X-TMN: [XSIqgCj0R/4XJTaE9TdlCA+gy4CItqFV] 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-24-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8a9c655f-8a04-4a23-a5b8-08d9e583da15 X-MS-TrafficTypeDiagnostic: AM0PR03MB5700:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3wes3tmJpswBvgaI58S6AxtGSvlmKkZA8HvskShYR6qtNJtQXsQQrLoDPD8sEqWLTNeQys5VuHJFQqb9AxeQSTXOq28DDkVN4kUSH8pzlQ7QztBTaZhBuWFwlq0q/AH2rlsp2hi28rZsyYQvM86+gi88jDot6lXbDe5hzr7qTwEolpqumuOctXRyrKHiQM7VBZPexWvwoYXoBrnDp86PRpScWYWLx4myruxhyosm7+mXTm9Unh6umWhrf5hA1fJnrPxIo6lvUioA/I3JZAdVp9IDUdGpEbthCi+XrXwm/k2nymL95jef+neWeGJB0OcuMAMHCW4SW8sEwHfqTUovSayNasqNDonzmBRGTibpoWbj1xbYRzzJDrI3hE8BT7cO+INlA4FSfBviTVo8l1ZE6dfTQo+0TaywvzTmYibBNu/1vBPePKJWLycyQBtbdH9FC9sGli6dhLDJ/mSokLyBoODOv91RJBWOicoPI6LrOAi2bfpBdNDae3+3L9rVYwqph9vdOjexa7rdlBmLw7oJs6+1uDlmS1RYtKCH9ca1hQv3PX+Z4BlhK6fhaSzHcFqa X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uuA/WhVrOmZRS8p0LYBXb4jNTZIgByIJUYIu5MSKIHfBruNZ/rffFWekmDeJNnfuQHLMe/RRqLBjirj3q0nq6mxd7AEkMPHTanszFyJIXQv6k/R9iXyMdB0AJiS4MOfRwW05s2z9mh6NFOj/qR8+XXS3SPq6wFLV08rnSl+J+USNhRPknUIY50Dc2bkXXbuuKM/SUJchuqB6Sz3Kf8vCfb4XykeCTNRX/nll6VD/V2/b+7cAIo90FC72eDJ57AjiXcUacfgRGBwNrUy4cAt5vTyhsW4HZRJkKJ/el6MFE87hjsB789yul2+THir+/+6De1QfQb7imCekL8yL04RblBVnPVjI3H4kC4Fs6HB2SJ5r1UyCMvR5fkACgeuuAqcMw9JPhEm7l12T5yRPOgnp7OyS12No4I0dpvElSyarY+bPM8KLhJKnXhQXr6QV5gb8czDEbMpxB2EmG90H2aWk0jbRXtpLHz8zKw4EVskR/4Ahrs9s/2o5Qltqfr8gQVRTi7DOfKDWcNlkvHH0ITKHkwEyt+KcVmLWDyrZnMYwN+qiVojcuZ6mLEI+LCTzFlhe75gyvDLFGWfsuuhaRj+eoDTXG3NvQwOLREUcXOnb16Z6BcNblcpN9fSB5SGH5fy+HO7Xsxw+jzGZXPct/b90icJ0AVETetn/+XDrIa/bMjBWlU5vsyGSsK/PCW8DnBSwkBHtpUdaX3s+eX3NwlfRVRWoIBjfjd0P/SNtJW43USJuAbOAYQDIgDgbES4acKLKG7XB9nNE/0Vx5nfo8ygQU3yMarzh0wv0qQw/vQGHRj+rh5EOJzsZGRJ1Pl1ah/q1+VEKkOfgZhSebG8ACryMXN5LzqldCIRDP+2BU7avFRmCXsdAuRR1mHoKchFgLDhIxD1F9awP1dqXgNbBXtIrRUbPxCy4YtWGl7PL5bcwHi15v5jeZ/UUSRUxOQMjmx+QJzNjPKFmQMAWzE5fJ52M2w== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a9c655f-8a04-4a23-a5b8-08d9e583da15 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:51.2745 (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 25/69] avcodec/speedhqenc: Add SpeedHQEncContext and move slice_start to it X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org> List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe> List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel> List-Post: <mailto:ffmpeg-devel@ffmpeg.org> List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help> List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe> Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org> X-TUID: v/GBoKh87AT2 |
Series |
[FFmpeg-devel,v2,01/69] avcodec/avcodec: Avoid MpegEncContext in AVHWAccel.decode_mb
|
expand
|
Context | Check | Description |
---|---|---|
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
andriy/make_ppc | success | Make finished |
andriy/make_fate_ppc | success | Make fate finished |
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index c4ac7bc966..e31ad2ccff 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -419,9 +419,6 @@ typedef struct MpegEncContext { int inter_intra_pred; int mspel; - /* SpeedHQ specific */ - int slice_start; - /* decompression specific */ GetBitContext gb; diff --git a/libavcodec/speedhqenc.c b/libavcodec/speedhqenc.c index 5b40011e40..2a8ddebb0a 100644 --- a/libavcodec/speedhqenc.c +++ b/libavcodec/speedhqenc.c @@ -54,6 +54,12 @@ static uint32_t speedhq_chr_dc_uni[512]; static uint8_t uni_speedhq_ac_vlc_len[64 * 64 * 2]; +typedef struct SpeedHQEncContext { + MpegEncContext m; + + int slice_start; +} SpeedHQEncContext; + static av_cold void speedhq_init_static_data(void) { ff_rl_init(&ff_rl_speedhq, speedhq_static_rl_table_store); @@ -121,24 +127,27 @@ av_cold int ff_speedhq_encode_init(MpegEncContext *s) void ff_speedhq_encode_picture_header(MpegEncContext *s) { + SpeedHQEncContext *ctx = (SpeedHQEncContext*)s; + put_bits_le(&s->pb, 8, 100 - s->qscale * 2); /* FIXME why doubled */ put_bits_le(&s->pb, 24, 4); /* no second field */ + ctx->slice_start = 4; /* length of first slice, will be filled out later */ - s->slice_start = 4; put_bits_le(&s->pb, 24, 0); } void ff_speedhq_end_slice(MpegEncContext *s) { + SpeedHQEncContext *ctx = (SpeedHQEncContext*)s; int slice_len; flush_put_bits_le(&s->pb); - slice_len = s->pb.buf_ptr - (s->pb.buf + s->slice_start); - AV_WL24(s->pb.buf + s->slice_start, slice_len); + slice_len = put_bytes_output(&s->pb) - ctx->slice_start; + AV_WL24(s->pb.buf + ctx->slice_start, slice_len); /* length of next slice, will be filled out later */ - s->slice_start = s->pb.buf_ptr - s->pb.buf; + ctx->slice_start = put_bytes_output(&s->pb); put_bits_le(&s->pb, 24, 0); } @@ -271,7 +280,7 @@ const AVCodec ff_speedhq_encoder = { .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_SPEEDHQ, .priv_class = &ff_mpv_enc_class, - .priv_data_size = sizeof(MpegEncContext), + .priv_data_size = sizeof(SpeedHQEncContext), .init = ff_mpv_encode_init, .encode2 = ff_mpv_encode_picture, .close = ff_mpv_encode_end,
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/mpegvideo.h | 3 --- libavcodec/speedhqenc.c | 19 ++++++++++++++----- 2 files changed, 14 insertions(+), 8 deletions(-)