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 9588946578 for ; Sun, 21 May 2023 23:17:54 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CAC4868C084; Mon, 22 May 2023 02:17:51 +0300 (EEST) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 31D1F6805B4 for ; Mon, 22 May 2023 02:17:46 +0300 (EEST) Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-3f42c865534so52773365e9.2 for ; Sun, 21 May 2023 16:17:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684711064; x=1687303064; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:to:from:date:from:to:cc:subject:date:message-id :reply-to; bh=qzbYDrDcDhh5mjbZWnpF0pruSRPvML0zLfHOyTXhwAc=; b=KtxXelShg5L7X9t3YeInBgFIkNQPDKtE2ShM1iwalE0nPXr8aROzKO3FfJxovioVgK Em35+3sqxSLlFri7ebG8kzfvEsTpbfystnhMEJRPwOHZSwlW7UsD1TDRe/tf314knpMQ A4c8oeu5C/IjZzK5bC3xXqYklsjh+zvP6W+NXzeR2SdS1QsbXJ0OBmCBd2vDsh3zihJX Cpir3JsKCIA1ipWI4xy74d/FGAbqjrpZMJp73I95tVb4/xqXKCrRmygCu/0Jt19G5y/5 BVskO6S8RvWFMiRuF8pEpfs7SxBN9iwKffEq/69/lP3mwWvukJOpE1OTPLBQePf9XTT1 ETxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684711064; x=1687303064; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qzbYDrDcDhh5mjbZWnpF0pruSRPvML0zLfHOyTXhwAc=; b=VdTpinK8Izg+baTeozw1x+/vlA1THxgbCSuMOK1naw4xJw4Jgl9EN6nQieRwubMgeF pJ1ip62zWCrOJlsKlmVOmvYqn13jniPu/nt8gvGcunHrMaQyPkBkUPaklQWPZ6KdtR3q pr9zubWLHo+i12HkQT9YzJbnADtlvFaxVgzFjR4L5Gh3rk00hCTU7SaD2LnYNXqnVDgk g6qG9eqVWfNwc6Rt/qw0ePWkarHzUNw/4eE1wGavypEAbh3+hb3Ls5VO6KdvlfBl84nr rluv955T7CJTs1RGesv8df6/VsNAY69Cmowbt9UJ5s5DwxOsKwxoTHuXseWrmcTsfpxM lP6A== X-Gm-Message-State: AC+VfDx114IM76U1K+8NiGdXIfLAwnLJNuxpMy42/RagIsJKlP4TRFcE HOevgB0SXY4tQ/l2fq8MMIQe+oobcpE= X-Google-Smtp-Source: ACHHUZ6xBpGI2mN2nuvZQHfuCt/kSPfXZaOUWcaZnGbbrY8UYwcMDiI1ZTR/qeiAANm+oYkq00TaMg== X-Received: by 2002:a1c:7909:0:b0:3f4:1dd9:e9dd with SMTP id l9-20020a1c7909000000b003f41dd9e9ddmr6564386wme.2.1684711064447; Sun, 21 May 2023 16:17:44 -0700 (PDT) Received: from mariano ([91.254.67.164]) by smtp.gmail.com with ESMTPSA id f18-20020adfdb52000000b002f7780eee10sm5822891wrj.59.2023.05.21.16.17.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 May 2023 16:17:43 -0700 (PDT) Received: by mariano (Postfix, from userid 1000) id 6EDC5BFB73; Mon, 22 May 2023 01:17:41 +0200 (CEST) Date: Mon, 22 May 2023 01:17:41 +0200 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: <20230521231741.GB14958@mariano> Mail-Followup-To: FFmpeg development discussions and patches References: <8eb9290f3c9cdae75b38c45a5d49ee624951a849.camel@amazon.it> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <8eb9290f3c9cdae75b38c45a5d49ee624951a849.camel@amazon.it> User-Agent: Mutt/1.13.2 (2019-12-18) 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="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On date Friday 2023-05-19 10:19:03 +0000, Carotti, Elias wrote: > = > Hi again, > I am sending this patch again (I had missed a check for NULL), could > somebody please have a look at it?=A0 > = > It is mainly an optimization when the encoder knows in advance that > only portions of the whole frame changed and which areas actually did. > = > The patch allows a user to pass down information to libx264 information > about which parts of a frame changed (with respect to the preceding > one) to be exploited as a hint for P_SKIP-ing macroblocks which didn't > change.=A0 > This information is encoded in the mb_info field of the x264_param_t > much like the quant_offsets which are already used for the > AV_FRAME_DATA_REGIONS_OF_INTEREST side information. Please send a git format-patch (complete with commit log information) to simplify integration. [...] > diff --git a/libavutil/mb_info.h b/libavutil/mb_info.h > new file mode 100644 > index 0000000000..918cf167aa > --- /dev/null > +++ b/libavutil/mb_info.h > @@ -0,0 +1,46 @@ [...] > +#ifndef AVUTIL_MB_INFO_H > +#define AVUTIL_MB_INFO_H > + > +#include > +#include > +#include "libavutil/avassert.h" > +#include "libavutil/frame.h" > + > +typedef struct _AVMBInfoRect { nit: strip the _ before the struct name > + uint32_t x, y; > + uint32_t width, height; > +} AVMBInfoRect; > + > +/** > + * Allocate memory for a vector of AVMBInfoRect in the given AVFrame > + * {@code frame} as AVFrameSideData of type AV_FRAME_DATA_MB_INFO. > + * The side data contains a list of rectangles for the portions of the f= rame > + * which changed from the last encoded one. The rest will be hinted to be > + * P_SKIP-ped. Portions of the rects which are not on macroblock bounda= ries > + * are not handled as P_SKIPS. > + */ > +AVMBInfoRect *av_mb_info_create_side_data(AVFrame *frame, > + AVMBInfoRect *rects, > + size_t num_rects); Probably this can be generalized with a flag defining the hinting type (you might want either to specify the constant or non-constant rects), in fact this data is pretty macro-block agnostic. What about AVVideoHintInfo containing a hint (CONSTANT, VARIANT) and a list of rects? _______________________________________________ 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".