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 9A4534573D for ; Thu, 23 Mar 2023 11:32:56 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 743E668C29E; Thu, 23 Mar 2023 13:32:53 +0200 (EET) Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E70A868C26E for ; Thu, 23 Mar 2023 13:32:46 +0200 (EET) Received: by mail-oi1-f176.google.com with SMTP id bo10so15866561oib.11 for ; Thu, 23 Mar 2023 04:32:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679571165; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=qbOns2X7Q/AqJptXimtpsO00zlceMu/J+BdCWtW/J3w=; b=jd3Y5lmm4BWsBy/+nu0xxvstnc2XiRLsvUOhXGVWuLVvl5R+i1lM4yJ0Ofmjjycl/J mP/D6C/hJyqNwP58XnNTuBKlBzcAOF+OpPovj7bMJTVDJgDoMcBtdawyY3VKRkD6Mk0k x2CawH0eLwHnY+lkr/DGLadP1deHC3AkyhxOIlQPNPQ/fS3IMnPNqGSMreZ48Oa2Ggfu ytp3bktXt5IqWQb5JxClBUhVtdg5gLdOyB14a143Xy+HfG2fXcLqqm2d6qQbV9VK+uy4 MRbqKrNoICK0GyFgg4lW0NLXUezE7FKOUQZWXxwyE/nWKyAGPu/1LEV7o37WjRU5cjf4 JEMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679571165; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qbOns2X7Q/AqJptXimtpsO00zlceMu/J+BdCWtW/J3w=; b=3pu6T31HrQA3Vu15PWKLdVesikNzjG1ObFr/RZVvMEyVV8LREq4kfTHjVKXeDIguHM GobXM/XRBAD+F7EKtly3z8P5ptRsjFbTxNXALmJky1kbg9LsoiEGjexAx7EFX/y2PARY vBjwA1zCBN+rrMjCO1DaSRWrGxIAyoR32NTTGFblX3/P1WtkCdxIhsy63LJjZuZaMWdH Ra0U3uEu11xdMIfGmdmmkhWTNceIHL9/aSCn4BSFe9hq0dtYCVbuhtUb+VqZepeejN/M CcLQWzcMPoior3HE25vt86frZpPNcVeqNQo1vZWuabHk0eU1mkDSsQrjhkHjJOzWI0g9 GFjA== X-Gm-Message-State: AO0yUKW4SjKCoG2QMpQK+zYgNPeGz0odsPlc6bkmBPdX/tjZevdi0kry lk3yWJl7hE9xTtMm7fG6JonGWZG5bsQ= X-Google-Smtp-Source: AK7set8Cb90t4ZkK+SNkJGDoiO8jyiuUFi1E/Jad16iahWeBuYWlFj158H3/8eNDuPJmibJhoTXMOQ== X-Received: by 2002:a54:4e02:0:b0:378:6035:adda with SMTP id a2-20020a544e02000000b003786035addamr2761919oiy.25.1679571164706; Thu, 23 Mar 2023 04:32:44 -0700 (PDT) Received: from [192.168.0.14] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id o79-20020a4a2c52000000b0053b8ae294f3sm1078884ooo.11.2023.03.23.04.32.43 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Mar 2023 04:32:44 -0700 (PDT) Message-ID: Date: Thu, 23 Mar 2023 08:32:48 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 To: ffmpeg-devel@ffmpeg.org References: <20230319194240.15001-1-michael@niedermayer.cc> <20230323095034.GL375355@pb2> Content-Language: en-US From: James Almer In-Reply-To: <20230323095034.GL375355@pb2> Subject: Re: [FFmpeg-devel] [PATCH v2 1/3] avcodec/snowenc: AV_CODEC_CAP_ENCODER_RECON_FRAME support 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 3/23/2023 6:50 AM, Michael Niedermayer wrote: > On Mon, Mar 20, 2023 at 07:07:59PM -0300, James Almer wrote: >> On 3/19/2023 4:42 PM, Michael Niedermayer wrote: >>> Signed-off-by: Michael Niedermayer >>> --- >>> libavcodec/snowenc.c | 10 +++++++++- >>> 1 file changed, 9 insertions(+), 1 deletion(-) >>> >>> diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c >>> index 658684c575..5fb5906ed8 100644 >>> --- a/libavcodec/snowenc.c >>> +++ b/libavcodec/snowenc.c >>> @@ -26,6 +26,7 @@ >>> #include "avcodec.h" >>> #include "codec_internal.h" >>> #include "encode.h" >>> +#include "internal.h" //For AVCodecInternal.recon_frame >>> #include "me_cmp.h" >>> #include "packet_internal.h" >>> #include "snow_dwt.h" >>> @@ -1576,6 +1577,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, >>> { >>> SnowContext *s = avctx->priv_data; >>> RangeCoder * const c= &s->c; >>> + AVCodecInternal *avci = avctx->internal; >>> AVFrame *pic; >>> const int width= s->avctx->width; >>> const int height= s->avctx->height; >>> @@ -1877,6 +1879,10 @@ redo_frame: >>> s->encoding_error, >>> (s->avctx->flags&AV_CODEC_FLAG_PSNR) ? SNOW_MAX_PLANES : 0, >>> s->current_picture->pict_type); >>> + if (s->avctx->flags & AV_CODEC_FLAG_RECON_FRAME) { >>> + av_frame_unref(avci->recon_frame); >>> + av_frame_ref(avci->recon_frame, s->current_picture); >>> + } >>> pkt->size = ff_rac_terminate(c, 0); >>> if (s->current_picture->key_frame) >>> @@ -1934,7 +1940,9 @@ const FFCodec ff_snow_encoder = { >>> CODEC_LONG_NAME("Snow"), >>> .p.type = AVMEDIA_TYPE_VIDEO, >>> .p.id = AV_CODEC_ID_SNOW, >>> - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, >>> + .p.capabilities = AV_CODEC_CAP_DR1 | >>> + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE | >>> + AV_CODEC_CAP_ENCODER_RECON_FRAME, >>> .priv_data_size = sizeof(SnowContext), >>> .init = encode_init, >>> FF_CODEC_ENCODE_CB(encode_frame), >> >> Testing with the tool from https://git.khirnov.net/libav.git/commit/?h=recon&id=d78e17840347abfe10b2bc7e789c60665de56e1f >> (Which i hope will be upstreamed eventually) i get >> >> $ tools/enc_recon_frame_test input.y4m snow flags=+bitexact 10 >> Checksum mismatch in frame ts=0, plane 0 > > I cannot replicate this, using matrixbench and above command line i get no > mismatches, where can i find the input.y4m you used ? It was https://0x0.st/sfRh.y4m > > also would be nice if this tool would write a image showing the difference > > thx > >> >> I don't know if this really matters for snow (is it mean to be bitexact?), >> but it seems the very first frame returned by the reconstructed frame API is >> not the same as the one output by the snow decoder. The rest seem to match, >> though. > > This sounds rather strange, the first frame would be used as reference for > motion compensation so the subsequent frames matching after a mismatch is > "surprising" I tried other supported encoders like libx264 and librav1e and none of them report mismatches. > > thx > > [...] > > > _______________________________________________ > 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". _______________________________________________ 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".