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 394FD404DD for ; Thu, 22 Jun 2023 08:44:34 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5C01A68C054; Thu, 22 Jun 2023 11:44:31 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A85F7687FE9 for ; Thu, 22 Jun 2023 11:44:24 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id C8A682404EC for ; Thu, 22 Jun 2023 10:44:23 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id aSk7Buu1nBYd for ; Thu, 22 Jun 2023 10:44:23 +0200 (CEST) Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 2D3182404EA for ; Thu, 22 Jun 2023 10:44:23 +0200 (CEST) Received: by lain.khirnov.net (Postfix, from userid 1000) id 644BF1601B2; Thu, 22 Jun 2023 10:44:22 +0200 (CEST) From: Anton Khirnov To: "ffmpeg-devel@ffmpeg.org" In-Reply-To: References: <8eb9290f3c9cdae75b38c45a5d49ee624951a849.camel@amazon.it> <20230521231741.GB14958@mariano> <20230604152912.GC4274@mariano> <20230611171510.GA53039@mariano> <20230618101819.GC6623@mariano> Mail-Followup-To: "ffmpeg-devel@ffmpeg.org" Date: Thu, 22 Jun 2023 10:44:22 +0200 Message-ID: <168742346237.21886.2119907118968452752@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH] Optimization: support for libx264's mb_info 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-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: Quoting Carotti, Elias (2023-06-21 17:53:09) > + > + /** > + * Provide macro block encoder-specific hinting information for the encoder > + * processing. It can be used to pass information about which macroblock > + * can be skipped because it hasn't changed from the corresponding one in > + * the previous frame. This is useful for applications which know in > + * advance this information to speed up real-time encoding. Currently only > + * used by libx264. I'd avoid any such claims here, because this comment will certainly not be kept up to date. > +/** > + * Allocate memory for a vector of AVVideoRect in the given AVFrame > + * {@code frame} as AVFrameSideData of type AV_FRAME_DATA_VIDEO_HINT_INFO. > + * The side data contains a list of rectangles for the portions of the frame > + * which changed from the last encoded one (and the remainder are assumed to be > + * changed), or, alternately (depending on the type parameter) the unchanged > + * ones (and the remanining ones are those which changed). > + * Macroblocks will thus be hinted either to be P_SKIP-ped or go through the > + * regular encoding procedure. > + */ > +AVVideoHint *av_video_hint_create_side_data(AVFrame *frame, > + AVVideoRect *rects, > + size_t num_rects, > + AVVideoHintType type); > + > +AVVideoHint *av_video_hint_alloc(AVVideoRect *rects, > + size_t nb_rects, > + AVVideoHintType type, > + size_t *out_size); If AVVideoHint is extended in the future, you will have a weird situation where some fields are set by the allocation function, while others have to be set manually by the caller. You're also assuming the caller has an explicit array of AVVideoRect, while they may actually want to fill them in through some other means. Finally, it still seems to me this is largely duplicating AVVideoEncParams and you could get your functionality by adding your AVVideoHintType there. -- Anton Khirnov _______________________________________________ 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".