From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTP id 394FD404DD
	for <ffmpegdev@gitmailbox.com>; 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 <ffmpeg-devel@ffmpeg.org>; 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 <ffmpeg-devel@ffmpeg.org>; 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 <ffmpeg-devel@ffmpeg.org>;
 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 <ffmpeg-devel@ffmpeg.org>; 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 <anton@khirnov.net>
To: "ffmpeg-devel@ffmpeg.org" <ffmpeg-devel@ffmpeg.org>
In-Reply-To: <cf9872270a8220e18fedca64224a63b06f116617.camel@amazon.it>
References: <8eb9290f3c9cdae75b38c45a5d49ee624951a849.camel@amazon.it>
 <20230521231741.GB14958@mariano>
 <a260f35519ed25c2a8b72ffb90e3dbb9a7fd3db3.camel@amazon.it>
 <aea3841647f1f6ffa49cb139b680aff1b84ea2dd.camel@amazon.it>
 <20230604152912.GC4274@mariano>
 <c6d3eed119af4c08235eca8f3e7c72d66372961c.camel@amazon.it>
 <20230611171510.GA53039@mariano>
 <b1a707cc225c27be6c8dc3a9698df817818d7414.camel@amazon.it>
 <20230618101819.GC6623@mariano>
 <cf9872270a8220e18fedca64224a63b06f116617.camel@amazon.it>
Mail-Followup-To: "ffmpeg-devel@ffmpeg.org" <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 <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>
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>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/168742346237.21886.2119907118968452752@lain.khirnov.net/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

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".