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 3F00E477DA for ; Mon, 23 Oct 2023 10:15:01 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 31B4C68CA11; Mon, 23 Oct 2023 13:14:59 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0CD4468C337 for ; Mon, 23 Oct 2023 13:14:53 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id C7063240498 for ; Mon, 23 Oct 2023 12:14:52 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id fY4BlijF4vhY for ; Mon, 23 Oct 2023 12:14:52 +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 469F32400FF for ; Mon, 23 Oct 2023 12:14:52 +0200 (CEST) Received: by lain.khirnov.net (Postfix, from userid 1000) id 247A21601B9; Mon, 23 Oct 2023 12:14:52 +0200 (CEST) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: References: <04cb126b825dc1e39c3b4140af8813ddfd03dfdb.1697615459.git.pross@xvid.org> <7504e36707a4deaddc61e489839637137f7db7e5.1697615459.git.pross@xvid.org> <169764012197.32606.9720568022455222835@lain.khirnov.net> Mail-Followup-To: FFmpeg development discussions and patches Date: Mon, 23 Oct 2023 12:14:52 +0200 Message-ID: <169805609212.23937.3884949016595644745@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 2/3] avcodec/rv60: RealVideo 6.0 decoder 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 Peter Ross (2023-10-22 01:31:32) > On Wed, Oct 18, 2023 at 04:42:01PM +0200, Anton Khirnov wrote: > > Quoting Peter Ross (2023-10-18 10:03:54) > [..] > > I think you can simplify this into: > > if (s->last_frame[NEXT_PIC]->data[0]) { > > av_frame_move_ref(frame, s->last_frame[NEXT_PIC]); > > *got_frame = 1; > > } > [..] > > You just unreffed the frame above, what is the point of using > > reget_buffer()? > [..] > > The generic code should be doing this already. > [..] > > You could change this into av_frame_move_ref() and drop the unref below. > > many thanks anton for these suggestions. i agree with all of them. > > > > + if (s->pict_type != AV_PICTURE_TYPE_B) { > > > + s->ref_pts[0] = s->ref_pts[1]; > > > + s->ref_pts[1] = avpkt->pts; > > > + > > > + s->ref_ts[0] = s->ref_ts[1]; > > > + s->ref_ts[1] = s->ts; > > > + > > > + if (s->ref_pts[1] > s->ref_pts[0] && s->ref_ts[1] > s->ref_ts[0]) > > > + s->ts_scale = (s->ref_pts[1] - s->ref_pts[0]) / (s->ref_ts[1] - s->ref_ts[0]); > > > + } else { > > > + frame->pts = s->ref_pts[0] + (s->ts - s->ref_ts[0]) * s->ts_scale; > > > > This looks immensely evil. Isn't ff_get_buffer() already setting the > > timestamps correctly? > > no ff_reget_buffer() does not set pts correctly. > the ref_ts ('s->ts') value is sent with every rv60 in the header, and is > used to calculate the pts value. unsure how to make this less evil. Typically the timestamps come from the container, so the decoder merely copies them from packet to frame. Does the container not provide valid timestamps here? -- 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".