From patchwork Sat May 11 20:51:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 48765 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1706:b0:1af:cdee:28c5 with SMTP id nv6csp299138pzb; Sat, 11 May 2024 13:57:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVhemfodvkM43L7TPQa0F1jfefa4R5sv0TUyu/civjRB93/5h9vMal7VnOX4w8QXHY8YFjZv96FZXKV8laJo+etRF3U4sHPbuxGsA== X-Google-Smtp-Source: AGHT+IEbe8XvQOO8Zw5iJ9q8QlongzJyLKdhfBX+3mEFLVfJq3kor/Vc7DmlNDBs3hAjMs8TQGKi X-Received: by 2002:a17:906:38f:b0:a59:cdf4:f93d with SMTP id a640c23a62f3a-a5a2d5cb1dfmr381071166b.34.1715461050356; Sat, 11 May 2024 13:57:30 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a640c23a62f3a-a5a17b21be2si352085766b.473.2024.05.11.13.57.30; Sat, 11 May 2024 13:57:30 -0700 (PDT) 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=jAZxs4bT; 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 96F8D68D2F6; Sat, 11 May 2024 23:54:28 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04olkn2055.outbound.protection.outlook.com [40.92.74.55]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 51C1068D2F6 for ; Sat, 11 May 2024 23:54:27 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ol/a9PEB/yp9LmjSUNNVITxvSCu5g1Y2j4YSJFxDblNngISGjc5Cr524Lzc6ZX5WEe3AftInE0XdZBP0WRJRmBIx8fvhOB6G+5wHp3wfabnMwiM2vGNemVtYSa+4XQWvWaZHsc28TD82p+utc9IupCRIw2l63C1bx/M4I9n3rfHyjrHJF4aLjhTUhWpViunTL0sGN9XFK9SRCou+weH5D0dsdUWOdiL16gUQzE/4leY1ClXC/VmyOI6z++qM7tVSmDkK43drCpJnVbHYqUoRcBEvBqDz7rFRINB/OiXodknlCooIzJVW08jkSTWfCKvu7DemHXwyFmQP2EQswLfsrw== 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=BPy/y3FVhWiMW2AykmoMSPc5zPDpl4STsaxx1t5pRck=; b=PcC2M5NHB+261DBuoeOGDrjUucW9Qy6AB7+EVuaaNe+OLb52bHQyJ2jdM4Jwa3/rjCc4pfKID7Y6S8mqZtiEKmuXDUC/6FORrVFYRO85he0CZcnLMWyd5M1WbrpcHc9QYkNnyPYbLhzQiZg/kva2bn9t5fKbOTK46YC29EVB8T1e4RAtL7Es7iKXDS4wziKV0j5EWiQpFCXHC/0lC/0crpqnMGPyMW6XKC6G2z7m+l6xedcQQJFlBHoId6JPbTOt5O1dgbsB+92IRzSPpb+S9aE6rMucLekVtkn46dI2ieQjLT+O5NnJ+McAHXsfmlfU0JFK5IP/IG+/L+3xjuFwCA== 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=BPy/y3FVhWiMW2AykmoMSPc5zPDpl4STsaxx1t5pRck=; b=jAZxs4bTm2GBFXFVtc7UG7hbwZFCj30m/wqowzqis7RgPITIQTgaUpqL9ejc3jJJUfMXEsq5etwbj5fISeAzxgKZ9G/P0SDjwxX0orKodK0XcE9iwxv1oKWytJJ57jc6LPP14xtdf/IQ+0GTOk74ShUumgoMtulO4Ylyuv8sscpz//JXckRP10CPaC7Fg1TDgDNyALu2oVLOH0qWGAT0olZaiUJniEOTTwdfbRMy1ZmBPheIMU/SgfYaWnc2WgO7UpxIS1fTn7s42r9sUN45McAZtaYL/+ObD/OBMDPyPb6YOUbUQIODU75gtm8WGr/35rK8qmfA2DdkXy4F+2IAPw== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by DB9P250MB0403.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:327::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.54; Sat, 11 May 2024 20:54:25 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::d6a1:e3af:a5f1:b614]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::d6a1:e3af:a5f1:b614%7]) with mapi id 15.20.7544.052; Sat, 11 May 2024 20:54:25 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 11 May 2024 22:51:03 +0200 Message-ID: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: X-TMN: [s2m3N09nlmW0Eg6imlPAYzLXwfrHr0s2af/h1BIucsg=] X-ClientProxiedBy: ZR0P278CA0172.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:45::6) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20240511205135.2411886-38-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|DB9P250MB0403:EE_ X-MS-Office365-Filtering-Correlation-Id: 82be3313-37a7-4752-bab0-08dc71fc8a7a X-Microsoft-Antispam: BCL:0; ARA:14566002|461199019|440099019|3412199016|56899024|1710799017; X-Microsoft-Antispam-Message-Info: K+PcnqyhcuqVcYkys7nqes7XPsWu4AZXyqErNSCXllYkCF8Jg05li0at6+2JrHgTZf+xNn4GxNuQgxsCko9AyPeuc/i8MyMTaPb/eSktw+04YxWIQwqZYf8GKBcGhkWcKlBj309XOFiNJP5u409+EvVPx/KYSTnJDO2kcKrVm8IFXo6xDYtYlYG5YSU2Ua6ZtXvcNnXeRPRmXffwDKjwtpjcgWAOst+uLBEHJq5KVrfRkFRdHPhqoAVY9zrjhZwwhrvk7zKZzz9xqAelu1gRUV3F1GervY8+FS6WbxYDiHrQcmzMDrkfWPwg5tFgfubOWxc+dDY4NodXBXrF40tb8qE6JAZGSCDKyfsnKMHamDtmfwbrkWgmQGRyMNdP0Kg5P+QsmKKNhMCyyQWBYtUUxW6PReIgC7aC6+vnFv5D/RI0taO6H6Vq9rz48D0hfAx/q07IySPyF9QOibyXW7fKoVBFg7qzLO6ZI/09ecUPmbIrI+Q62RP7SfLb4hGIDlCuDMpvfOwkmXem6m0kIur/Uf2r0coHOpBOUlPJdcBKMbUS4yaQHLQ9qcWg1znKUnEaF27cf+BR/1qiGFi7GHIAKgq3fbi9FiJYZM/eFdE9BuDHKyY0mNFznxPZHJdp/pdj X-MS-Exchange-AntiSpam-MessageData-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CjvJvcYoEzfA0dNyblSg4d/ak3bLFA/0baMwixThC3R7odjxvUoxCxYDjGu4LjymwJ7lm2ZYJhHbw5egxTnLT5JDDlvHdlaFVHJMneO0hdV+jIqe0vTMVJm64NDn3z6OEcPJ3corbYKdSuSYzFfj1RAWEkJaD73WbTNbd2BwCdz/zp/zE2iOonRmmsMcFsYOfEimeoyethVL2wtKOUh9MswV10ITSkRaH7d1oqsV3aMp2FGICqWhZp6dCej/SWg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82be3313-37a7-4752-bab0-08dc71fc8a7a X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2024 20:54:25.1333 (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: DB9P250MB0403 Subject: [FFmpeg-devel] [PATCH v2 39/71] avcodec/mpegvideo_enc: Pass AVFrame*, not Picture* to alloc_picture() 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: fDqkuUuNMgpK It now only deals with the AVFrame and no longer with the accessories. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegvideo_enc.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index d4b280da05..c6f4cd9b0e 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1091,30 +1091,30 @@ static int get_intra_count(MpegEncContext *s, const uint8_t *src, return acc; } -static int alloc_picture(MpegEncContext *s, Picture *pic) +static int alloc_picture(MpegEncContext *s, AVFrame *f) { AVCodecContext *avctx = s->avctx; int ret; - pic->f->width = avctx->width + 2 * EDGE_WIDTH; - pic->f->height = avctx->height + 2 * EDGE_WIDTH; + f->width = avctx->width + 2 * EDGE_WIDTH; + f->height = avctx->height + 2 * EDGE_WIDTH; - ret = ff_encode_alloc_frame(avctx, pic->f); + ret = ff_encode_alloc_frame(avctx, f); if (ret < 0) return ret; - ret = ff_mpv_pic_check_linesize(avctx, pic->f, &s->linesize, &s->uvlinesize); + ret = ff_mpv_pic_check_linesize(avctx, f, &s->linesize, &s->uvlinesize); if (ret < 0) return ret; - for (int i = 0; pic->f->data[i]; i++) { + for (int i = 0; f->data[i]; i++) { int offset = (EDGE_WIDTH >> (i ? s->chroma_y_shift : 0)) * - pic->f->linesize[i] + + f->linesize[i] + (EDGE_WIDTH >> (i ? s->chroma_x_shift : 0)); - pic->f->data[i] += offset; + f->data[i] += offset; } - pic->f->width = avctx->width; - pic->f->height = avctx->height; + f->width = avctx->width; + f->height = avctx->height; return 0; } @@ -1186,7 +1186,7 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg) return ret; pic->shared = 1; } else { - ret = alloc_picture(s, pic); + ret = alloc_picture(s, pic->f); if (ret < 0) goto fail; ret = av_frame_copy_props(pic->f, pic_arg); @@ -1607,7 +1607,7 @@ no_output_pic: // input is a shared pix, so we can't modify it -> allocate a new // one & ensure that the shared one is reuseable av_frame_move_ref(s->new_pic, s->reordered_input_picture[0]->f); - ret = alloc_picture(s, s->reordered_input_picture[0]); + ret = alloc_picture(s, s->reordered_input_picture[0]->f); if (ret < 0) goto fail;