From patchwork Sun Jan 30 06:27:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 33912 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2c4e:0:0:0:0 with SMTP id x14csp1770168iov; Sat, 29 Jan 2022 22:29:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJy4k2hiYkPAZGikyimKEIVUyqQDqLLfLbJEJNPU6u09IDoFKG3z0ZxAj4CLC9vpcTnF1QEI X-Received: by 2002:a05:6402:518e:: with SMTP id q14mr15227692edd.155.1643524171800; Sat, 29 Jan 2022 22:29:31 -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 w16si5879527edl.87.2022.01.29.22.29.31; Sat, 29 Jan 2022 22:29:31 -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=qqeFU7TI; 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 171B868B15C; Sun, 30 Jan 2022 08:28:27 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-oln040092074062.outbound.protection.outlook.com [40.92.74.62]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 666CC68B0D6 for ; Sun, 30 Jan 2022 08:28:22 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f40xnG3gBbHLRsy6biMi3wil6ntW/Gvr9SOzIs2MDo8EQVRCAc5pissGE8FdySvixMGSUCyvc9nG91h+q1MceCWsEDsf9KziM9K4PG32E47vvPat3mGMfx633d4YKhS7gspydiw/NlQObNq+n54nNxNLIEcJ/mtxpdbNlykKmo9Jjj1S0A/mi90QB6TZILHBWNIF3JMY0uWWYWkzUQl08sw0l4WTah+jOiNZyijl4ArvB86/DWp9PoG6sTCwWUYIMwafqqfa4uG1oW/35B1Yzklf90lE4FRO027JlNxd1HL/YJZJpakGZXWzqrHEP+Q8XAqkZj1K/04jYtxM8UbwtA== 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=CBV717XShyx/F2OPF+V3xGJaFv57BybeWkXFJskLAbo=; b=M/DMVgLRCvlX4tNsrH9PsAucbJQ+IFqXju68o4zLzNVP6WtwygyxQEUZtlPIx3QVOn/v5nen4nrCiMlyNbp5qV85FmmBEptYnONJtlu1wZrajUrCyJzc/GmE1p9uYExa3atzwzI+XLuc1Wr6/8ByTYO6AIc9fDjb+1ES40kTbYuwUSScMhmGzIRNMcZ1POkLXU86aUFsaGGybSLhZ4PRf57So35oGUBYXrQFv4cp4yeMzY64Z6YEH11TjeFCfMkZOm+BXojSzE+8mExKNluXJXz9OKLiujcWUlkxfO8I9WfclayP9wdBDMo87yq5n+hbievSaeqza32us5SVuVJbDg== 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=CBV717XShyx/F2OPF+V3xGJaFv57BybeWkXFJskLAbo=; b=qqeFU7TITNmvWbYp0GpRTF4/BgvBMIcgc0jNGrZtuR6E7nCxQlmskhUF8LZimi22DvgbuLuKGB3QtDQEI8G1m5c52lmslUNEbbjzyo+7eaWGaSYv84U7BFlTNb+WpXi69CBv7ePMCYjLNKXhQ1KwTFvQ999ElM8vmySPrNOXWpLZHH1CXg8FTVSeygBVs46r8ztR2VEEeLJ0rmXtDBRDYmCNb4yiXCTsnRtlLqeYeNUf5ClqmcJlZebfrRvY5F6s0VRZeoB9D4ZDP8L+LXxLA4EE9bfL9rWCnaMCSL9V9xyXNluuvy7pk4XSIKU36dBHJSEtW6yVln1y7gaJ8BQrvw== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB4247.eurprd03.prod.outlook.com (2603:10a6:20b:7::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.20; Sun, 30 Jan 2022 06:28:20 +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.4930.021; Sun, 30 Jan 2022 06:28:20 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 30 Jan 2022 07:27:17 +0100 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [jZGZIsBqv9ymQz0EcHIO+y4dp8IzCYxJ] X-ClientProxiedBy: AM6PR10CA0044.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:80::21) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20220130062749.936489-8-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 49276df0-6c73-417c-1cd5-08d9e3b9b5a9 X-MS-TrafficTypeDiagnostic: AM6PR03MB4247:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PlizJ2IOavJ9JomRWCcQLmok3sTYLuPWxjY+tlDs4BQX2kIVqYcJd65rRocuUodJxlrtTjs+6Ynay+jppVI/3q4eAr915vJqJT6LyRevdZPsgunxjFuhAPsE/AYNgZF+PHe5+RQTbag3PZQKKJGsE/sYiL3U/CrDec1NsTPOHUPzfJBp6PABKtsS6ooqc2yNGA5v1YMEC+olnQiTaoUNmhyfOy6s7Mzuez8KfOtr8MamglXvukermDpKkE2eeUwW03OILLYlqy7pWzsmdpa5GqmMzSm0I1hHi7Gto9a8DAFCFwZXmHC9iZ88d26Y6K5BoGIXtqT9chkM2L1/BGZHfcIWimoNWEjnegFI7m5RbwIt8sm2NxvAH47dtROE7LzLCzL4XqLNoQK6dh0dEyiii57iIPrleyi9ZK/1FYjbPg9xKkcI9r0tpB0GImuxeLQAY/6JxCeK8O4AHGm81SvZZHfOm4fIPpD6inYPgwvHVCgfJDF+/akPBpcKXswfqkXHDd6CtaSjQ40mkOxGQX7pNq/t8G+QxHa2dH2+HuwN6dtUNaakbF+yN7vAAXfj9/EF X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: htXfhmYPiIob7vDPAXA0EPW022buqFpz6F6wzayfNL2dm64HEAHxkZDogjqOHa+QG4ZcNCQ4ak5CkGEwS9k59maUbUfwn8AyHuBh5T9hdReccWJGNuJg0CsnPPrTiBL55wvcZ6kmyJNjWjjxODMPmiFNQ0LsIFC8bUzSJymfDR7vTw9rhgoW0mkaMqFSVCKQ0AL0p+56+JgepW4wNGfKolm4XUl2rcN2z1/FCyA7Y3zrC46swKGHlzr3TEKUoh5osNGul1Ud3ZMF2JX3EGc5LkDGeDLzhoLLhBefLXvYC0jiuT9V8qCZGWj+Usvr5UBlSDywPn20Z9WED1veB5IhGgB8qXZMUCDxPcLRL98nlyMgLhmgpqQALRFlzNChrGlXr8/jH11We4c0izRPhHeh3EwSJTZcnDMPN5nG5HDOBANU1tkYhiepfM0bLptAD26XlfOIG+ZA1uz3WJIPWzLvQD4u/iv4VqoTfKQjN5NTbNlGalaQyd8YE8L4JttAGltrIL9KwTwjH7XPKpf4EyCHwZpXU0B/ohaS1reZQT5K6fPPyOkwd/7aSNQyYfeMtfZXRLGs+VZ1zQ4YT2Oo9neeSZOnGo3NmtY1gfDBpfu+HbpewuuHlwJmW11suFxVBtYRk6Dq7ZwEI4JBCLDT2XaIGEKBc9TgPmwJbzFpl5PsrI1ipcATnGozEgE6xmUCRKVFjyuM6M2mJHBExsPBYgqUCMYxQimTbZdt9fFF8KSSJ9cJCCC0pcfGpg50WbDSkOUEkIMVqcN+th4g0J5iKGrywHinwduQ5XPD+PL8+HMYI54W0zKodvlh1xdJgBnzv3AQnvHWnigr1Uuv2ZHfw1aMgCMnvRQxG6C0F39smG8k5DPHgBtbkdGP2tEPVRh51g47lSmrPMB7sa0zZJKAHfcoBJA44evrScJk2L9mNuMQMc07/GKJZ10sNpiZiux0IPe6Fq3R5bS9fJfBuQAmjCY7kw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49276df0-6c73-417c-1cd5-08d9e3b9b5a9 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2022 06:28:20.7880 (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: AM6PR03MB4247 Subject: [FFmpeg-devel] [PATCH 09/41] avcodec/wmv2: Split Wmv2Context into decoder and encoder context 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: UfLC0AGOkOme Signed-off-by: Andreas Rheinhardt --- libavcodec/wmv2.c | 6 ++--- libavcodec/wmv2.h | 26 +++--------------- libavcodec/wmv2dec.c | 64 +++++++++++++++++++++++++++++++------------- libavcodec/wmv2enc.c | 29 +++++++++++++++----- 4 files changed, 73 insertions(+), 52 deletions(-) diff --git a/libavcodec/wmv2.c b/libavcodec/wmv2.c index 57e1267782..8d1d117dea 100644 --- a/libavcodec/wmv2.c +++ b/libavcodec/wmv2.c @@ -25,9 +25,9 @@ #include "wmv2.h" -av_cold void ff_wmv2_common_init(Wmv2Context *w) +av_cold void ff_wmv2_common_init(MpegEncContext *s) { - MpegEncContext *const s = &w->s; + WMV2Context *const w = s->private_ctx; ff_blockdsp_init(&s->bdsp, s->avctx); ff_wmv2dsp_init(&w->wdsp); @@ -52,7 +52,7 @@ void ff_mspel_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t **ref_picture, op_pixels_func (*pix_op)[4], int motion_x, int motion_y, int h) { - Wmv2Context *const w = (Wmv2Context *) s; + WMV2Context *const w = s->private_ctx; uint8_t *ptr; int dxy, mx, my, src_x, src_y, v_edge_pos; ptrdiff_t offset, linesize, uvlinesize; diff --git a/libavcodec/wmv2.h b/libavcodec/wmv2.h index 1798dbabcd..4001093881 100644 --- a/libavcodec/wmv2.h +++ b/libavcodec/wmv2.h @@ -21,9 +21,6 @@ #ifndef AVCODEC_WMV2_H #define AVCODEC_WMV2_H -#include "libavutil/mem_internal.h" - -#include "intrax8.h" #include "mpegvideo.h" #include "wmv2dsp.h" @@ -33,29 +30,12 @@ #define SKIP_TYPE_COL 3 -typedef struct Wmv2Context { - MpegEncContext s; - IntraX8Context x8; +typedef struct WMV2Context { WMV2DSPContext wdsp; - int j_type_bit; - int j_type; - int abt_flag; - int abt_type; - int abt_type_table[6]; - int per_mb_abt; - int per_block_abt; - int mspel_bit; - int cbp_table_index; - int top_left_mv_flag; - int per_mb_rl_bit; - int skip_type; int hshift; +} WMV2Context; - ScanTable abt_scantable[2]; - DECLARE_ALIGNED(32, int16_t, abt_block2)[6][64]; -} Wmv2Context; - -void ff_wmv2_common_init(Wmv2Context *w); +void ff_wmv2_common_init(MpegEncContext *s); int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64]); int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number); diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c index dd0e2683f5..f9d91f9571 100644 --- a/libavcodec/wmv2dec.c +++ b/libavcodec/wmv2dec.c @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/mem_internal.h" + #include "avcodec.h" #include "h263dec.h" #include "internal.h" @@ -31,8 +33,28 @@ #include "wmv2.h" #include "wmv2data.h" - -static void wmv2_add_block(Wmv2Context *w, int16_t *block1, +typedef struct WMV2DecContext { + MpegEncContext s; + WMV2Context common; + IntraX8Context x8; + int j_type_bit; + int j_type; + int abt_flag; + int abt_type; + int abt_type_table[6]; + int per_mb_abt; + int per_block_abt; + int mspel_bit; + int cbp_table_index; + int top_left_mv_flag; + int per_mb_rl_bit; + int skip_type; + + ScanTable abt_scantable[2]; + DECLARE_ALIGNED(32, int16_t, abt_block2)[6][64]; +} WMV2DecContext; + +static void wmv2_add_block(WMV2DecContext *w, int16_t *block1, uint8_t *dst, int stride, int n) { MpegEncContext *const s = &w->s; @@ -40,7 +62,7 @@ static void wmv2_add_block(Wmv2Context *w, int16_t *block1, if (s->block_last_index[n] >= 0) { switch (w->abt_type_table[n]) { case 0: - w->wdsp.idct_add(dst, stride, block1); + w->common.wdsp.idct_add(dst, stride, block1); break; case 1: ff_simple_idct84_add(dst, stride, block1); @@ -61,7 +83,7 @@ static void wmv2_add_block(Wmv2Context *w, int16_t *block1, void ff_wmv2_add_mb(MpegEncContext *s, int16_t block1[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr) { - Wmv2Context *const w = (Wmv2Context *) s; + WMV2DecContext *const w = (WMV2DecContext *) s; wmv2_add_block(w, block1[0], dest_y, s->linesize, 0); wmv2_add_block(w, block1[1], dest_y + 8, s->linesize, 1); @@ -75,7 +97,7 @@ void ff_wmv2_add_mb(MpegEncContext *s, int16_t block1[6][64], wmv2_add_block(w, block1[5], dest_cr, s->uvlinesize, 5); } -static int parse_mb_skip(Wmv2Context *w) +static int parse_mb_skip(WMV2DecContext *w) { int mb_x, mb_y; int coded_mb_count = 0; @@ -140,7 +162,7 @@ static int parse_mb_skip(Wmv2Context *w) return 0; } -static int decode_ext_header(Wmv2Context *w) +static int decode_ext_header(WMV2DecContext *w) { MpegEncContext *const s = &w->s; GetBitContext gb; @@ -180,7 +202,7 @@ static int decode_ext_header(Wmv2Context *w) int ff_wmv2_decode_picture_header(MpegEncContext *s) { - Wmv2Context *const w = (Wmv2Context *) s; + WMV2DecContext *const w = (WMV2DecContext *) s; int code; if (s->picture_number == 0) @@ -215,7 +237,7 @@ int ff_wmv2_decode_picture_header(MpegEncContext *s) int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s) { - Wmv2Context *const w = (Wmv2Context *) s; + WMV2DecContext *const w = (WMV2DecContext *) s; if (s->pict_type == AV_PICTURE_TYPE_I) { if (w->j_type_bit) @@ -323,19 +345,19 @@ int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s) return 0; } -static inline void wmv2_decode_motion(Wmv2Context *w, int *mx_ptr, int *my_ptr) +static inline void wmv2_decode_motion(WMV2DecContext *w, int *mx_ptr, int *my_ptr) { MpegEncContext *const s = &w->s; ff_msmpeg4_decode_motion(s, mx_ptr, my_ptr); if ((((*mx_ptr) | (*my_ptr)) & 1) && s->mspel) - w->hshift = get_bits1(&s->gb); + w->common.hshift = get_bits1(&s->gb); else - w->hshift = 0; + w->common.hshift = 0; } -static int16_t *wmv2_pred_motion(Wmv2Context *w, int *px, int *py) +static int16_t *wmv2_pred_motion(WMV2DecContext *w, int *px, int *py) { MpegEncContext *const s = &w->s; int xy, wrap, diff, type; @@ -380,7 +402,7 @@ static int16_t *wmv2_pred_motion(Wmv2Context *w, int *px, int *py) return mot_val; } -static inline int wmv2_decode_inter_block(Wmv2Context *w, int16_t *block, +static inline int wmv2_decode_inter_block(WMV2DecContext *w, int16_t *block, int n, int cbp) { MpegEncContext *const s = &w->s; @@ -422,7 +444,9 @@ static inline int wmv2_decode_inter_block(Wmv2Context *w, int16_t *block, int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64]) { - Wmv2Context *const w = (Wmv2Context *) s; + /* The following is only allowed because this encoder + * does not use slice threading. */ + WMV2DecContext *const w = (WMV2DecContext *) s; int cbp, code, i, ret; uint8_t *coded_val; @@ -440,7 +464,7 @@ int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64]) s->mv[0][0][0] = 0; s->mv[0][0][1] = 0; s->mb_skipped = 1; - w->hshift = 0; + w->common.hshift = 0; return 0; } if (get_bits_left(&s->gb) <= 0) @@ -537,14 +561,16 @@ int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64]) static av_cold int wmv2_decode_init(AVCodecContext *avctx) { - Wmv2Context *const w = avctx->priv_data; + WMV2DecContext *const w = avctx->priv_data; MpegEncContext *const s = &w->s; int ret; + s->private_ctx = &w->common; + if ((ret = ff_msmpeg4_decode_init(avctx)) < 0) return ret; - ff_wmv2_common_init(w); + ff_wmv2_common_init(s); ff_init_scantable(s->idsp.idct_permutation, &w->abt_scantable[0], ff_wmv2_scantableA); ff_init_scantable(s->idsp.idct_permutation, &w->abt_scantable[1], @@ -557,7 +583,7 @@ static av_cold int wmv2_decode_init(AVCodecContext *avctx) static av_cold int wmv2_decode_end(AVCodecContext *avctx) { - Wmv2Context *w = avctx->priv_data; + WMV2DecContext *const w = avctx->priv_data; ff_intrax8_common_end(&w->x8); return ff_h263_decode_end(avctx); @@ -568,7 +594,7 @@ const AVCodec ff_wmv2_decoder = { .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 8"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_WMV2, - .priv_data_size = sizeof(Wmv2Context), + .priv_data_size = sizeof(WMV2DecContext), .init = wmv2_decode_init, .close = wmv2_decode_end, .decode = ff_h263_decode_frame, diff --git a/libavcodec/wmv2enc.c b/libavcodec/wmv2enc.c index ab5365d1f6..a7827f3194 100644 --- a/libavcodec/wmv2enc.c +++ b/libavcodec/wmv2enc.c @@ -25,8 +25,21 @@ #include "msmpeg4data.h" #include "wmv2.h" - -static int encode_ext_header(Wmv2Context *w) +typedef struct WMV2EncContext { + MpegEncContext s; + WMV2Context common; + int j_type_bit; + int j_type; + int abt_flag; + int abt_type; + int per_mb_abt; + int mspel_bit; + int cbp_table_index; + int top_left_mv_flag; + int per_mb_rl_bit; +} WMV2EncContext; + +static int encode_ext_header(WMV2EncContext *w) { MpegEncContext *const s = &w->s; PutBitContext pb; @@ -54,12 +67,14 @@ static int encode_ext_header(Wmv2Context *w) static av_cold int wmv2_encode_init(AVCodecContext *avctx) { - Wmv2Context *const w = avctx->priv_data; + WMV2EncContext *const w = avctx->priv_data; + MpegEncContext *const s = &w->s; + s->private_ctx = &w->common; if (ff_mpv_encode_init(avctx) < 0) return -1; - ff_wmv2_common_init(w); + ff_wmv2_common_init(&w->s); avctx->extradata_size = 4; avctx->extradata = av_mallocz(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); @@ -73,7 +88,7 @@ static av_cold int wmv2_encode_init(AVCodecContext *avctx) int ff_wmv2_encode_picture_header(MpegEncContext *s, int picture_number) { - Wmv2Context *const w = (Wmv2Context *) s; + WMV2EncContext *const w = (WMV2EncContext *) s; put_bits(&s->pb, 1, s->pict_type - 1); if (s->pict_type == AV_PICTURE_TYPE_I) @@ -147,7 +162,7 @@ int ff_wmv2_encode_picture_header(MpegEncContext *s, int picture_number) void ff_wmv2_encode_mb(MpegEncContext *s, int16_t block[6][64], int motion_x, int motion_y) { - Wmv2Context *const w = (Wmv2Context *) s; + WMV2EncContext *const w = (WMV2EncContext *) s; int cbp, coded_cbp, i; int pred_x, pred_y; uint8_t *coded_block; @@ -220,7 +235,7 @@ const AVCodec ff_wmv2_encoder = { .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_WMV2, .priv_class = &ff_mpv_enc_class, - .priv_data_size = sizeof(Wmv2Context), + .priv_data_size = sizeof(WMV2EncContext), .init = wmv2_encode_init, .encode2 = ff_mpv_encode_picture, .close = ff_mpv_encode_end,