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 1C8AF42A05 for ; Mon, 11 Apr 2022 16:32:43 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C716C68B2BB; Mon, 11 Apr 2022 19:32:40 +0300 (EEST) Received: from mail-oa1-f53.google.com (mail-oa1-f53.google.com [209.85.160.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4090E68B137 for ; Mon, 11 Apr 2022 19:32:34 +0300 (EEST) Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-dacc470e03so17813958fac.5 for ; Mon, 11 Apr 2022 09:32:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=I3WYUyTf6k+bDoo4dPINUmXRy1K5Ix1hotNNYbtl0tg=; b=dlCrx9+ZunpV0GYG/lq1IJRJQfgK4iwsg5EfGyadoy3ZmYmzR4F/xIwqg+EW61phCW E/AhnAyMY/w56URfdBisqR0Qh5Gk49ZlTob6KjW/8ZdnDT8HPg8XTZLMq3FMsJxC2FY3 8O1fDA4k23zA20z2iwShduEWNVb2Btfl3Tyw1nFy81ysFMc1XDu75ziVgTJs8H57s1Vr 7E7vp8nNkMgSqvt7zgrghCdDWSemWULmxZhNKmy/9tj5UtEkBhjZH/ei48azBg2n3uy2 ch8+wAnlW6BW+vPkayCLCgzX2Uv+w7j4Dz9tfb0jJM451K5Nphhas7YJ+b+l2MAwUyEU NX/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=I3WYUyTf6k+bDoo4dPINUmXRy1K5Ix1hotNNYbtl0tg=; b=fVza7up/iQ1h0dOHvr0W3CrYlrZaVPFFX6KblIHvq7RA5PLfqZZIS3+7Pf2+R8FRBh lv2fx2fdpulycz+8ZN2qUULIDxsuUEX7I6M2hOwLNzJXT+pu9WsLwfWluPJqlFlRHuig lp4UhxdZsCgdV5+Tde2nutNbKu332xe5gQM59+fepnOy2hihyavR/f9r54WeTwIpfkmA ostyCeC/ttrnjLHkYyG1ZPe0BbxZVd/oMBlv9Zu9gL8vZODg2t3FLxasIJQc3B/eZecX ij2jwjDBcWfh7FCwx6TdQhOis+/pMPPGwRvxX2lZ2qLMy+Mi4eEq7xKv0Bs3PRqqSLeI fcnQ== X-Gm-Message-State: AOAM531arC/9av38R0WuDid2jB2gTny/GWm1PIcaN3EBpmQJ5g/MvLmR /LXy5lHI46nBWr+ynAIKfZpNRPESCcQ= X-Google-Smtp-Source: ABdhPJx/gknzxT3xAHcjLKF7TIHJZQvqWqBljqof4C9fZMZy8zCVKDfC+ukUmls9iDPexwFXyteM3A== X-Received: by 2002:a05:6870:f588:b0:dd:a466:a208 with SMTP id eh8-20020a056870f58800b000dda466a208mr14084867oab.291.1649694752392; Mon, 11 Apr 2022 09:32:32 -0700 (PDT) Received: from [192.168.0.12] ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id r6-20020a0568301ac600b005cdbc6e62a9sm12278928otc.39.2022.04.11.09.32.30 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Apr 2022 09:32:31 -0700 (PDT) Message-ID: <8f9ab35a-863e-44fa-eb69-759cb9f0f9c5@gmail.com> Date: Mon, 11 Apr 2022 13:32:30 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <367f4d8c-5a36-af62-b4de-f2b0f69458d0@gmail.com> <20220411083908.28802-1-anton@khirnov.net> From: James Almer In-Reply-To: <20220411083908.28802-1-anton@khirnov.net> Subject: Re: [FFmpeg-devel] [PATCH] lavc/encode: drop EncodeSimpleContext 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 4/11/2022 5:39 AM, Anton Khirnov wrote: > It has only a single member. > --- > libavcodec/avcodec.c | 4 ++-- > libavcodec/encode.c | 7 +++---- > libavcodec/internal.h | 12 +++++++----- > 3 files changed, 12 insertions(+), 11 deletions(-) > > diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c > index c7daa385e7..e0f38ac42a 100644 > --- a/libavcodec/avcodec.c > +++ b/libavcodec/avcodec.c > @@ -432,7 +432,7 @@ void avcodec_flush_buffers(AVCodecContext *avctx) > while (av_fifo_read(avci->pkt_props, avci->last_pkt_props, 1) >= 0) > av_packet_unref(avci->last_pkt_props); > > - av_frame_unref(avci->es.in_frame); > + av_frame_unref(avci->in_frame); > av_packet_unref(avci->in_pkt); > > if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME) > @@ -498,7 +498,7 @@ av_cold int avcodec_close(AVCodecContext *avctx) > av_packet_free(&avci->last_pkt_props); > > av_packet_free(&avci->in_pkt); > - av_frame_free(&avci->es.in_frame); > + av_frame_free(&avci->in_frame); > > av_buffer_unref(&avci->pool); > > diff --git a/libavcodec/encode.c b/libavcodec/encode.c > index 837ffaa40d..8b0d4443cd 100644 > --- a/libavcodec/encode.c > +++ b/libavcodec/encode.c > @@ -175,8 +175,7 @@ int ff_encode_get_frame(AVCodecContext *avctx, AVFrame *frame) > static int encode_simple_internal(AVCodecContext *avctx, AVPacket *avpkt) > { > AVCodecInternal *avci = avctx->internal; > - EncodeSimpleContext *es = &avci->es; > - AVFrame *frame = es->in_frame; > + AVFrame *frame = avci->in_frame; > const FFCodec *const codec = ffcodec(avctx->codec); > int got_packet; > int ret; > @@ -565,8 +564,8 @@ FF_ENABLE_DEPRECATION_WARNINGS > avctx->internal->intra_only_flag = AV_PKT_FLAG_KEY; > > if (ffcodec(avctx->codec)->encode2) { > - avci->es.in_frame = av_frame_alloc(); > - if (!avci->es.in_frame) > + avci->in_frame = av_frame_alloc(); > + if (!avci->in_frame) > return AVERROR(ENOMEM); > } > > diff --git a/libavcodec/internal.h b/libavcodec/internal.h > index f9d08fcb60..2fa56d3a59 100644 > --- a/libavcodec/internal.h > +++ b/libavcodec/internal.h > @@ -47,10 +47,6 @@ > # define STRIDE_ALIGN 8 > #endif > > -typedef struct EncodeSimpleContext { > - AVFrame *in_frame; > -} EncodeSimpleContext; > - > typedef struct AVCodecInternal { > /** > * When using frame-threaded decoding, this field is set for the first > @@ -101,7 +97,13 @@ typedef struct AVCodecInternal { > > void *frame_thread_encoder; > > - EncodeSimpleContext es; > + /** > + * The input frame is stored here for encoders implementing the simple > + * encode API. > + * > + * Not allocated in other cases. > + */ > + AVFrame *in_frame; > > /** > * If this is set, then FFCodec->close (if existing) needs to be called LGTM. _______________________________________________ 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".