Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Anton Khirnov <anton@khirnov.net>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 2/3] avcodec/rv60: RealVideo 6.0 decoder
Date: Mon, 23 Oct 2023 12:14:52 +0200
Message-ID: <169805609212.23937.3884949016595644745@lain.khirnov.net> (raw)
In-Reply-To: <ZTRfVOzRgB5PIl_B@381ffcaa0aae670d3ff23e2d15497aef>

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

  reply	other threads:[~2023-10-23 10:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-18  7:54 [FFmpeg-devel] [PATCH 1/3] avformat/rmdec: support RMHD file format Peter Ross
2023-10-18  8:03 ` [FFmpeg-devel] [PATCH 2/3] avcodec/rv60: RealVideo 6.0 decoder Peter Ross
2023-10-18 14:42   ` Anton Khirnov
2023-10-21 23:31     ` Peter Ross
2023-10-23 10:14       ` Anton Khirnov [this message]
2023-10-23 16:38         ` Peter Ross
2023-10-22 13:37   ` Andreas Rheinhardt
2023-10-23 10:12     ` Peter Ross
2023-10-18  8:07 ` [FFmpeg-devel] [PATCH 3/3] fate: rv60 test cases Peter Ross
2024-03-02 23:36 [FFmpeg-devel] [PATCH 1/3] avformat/rmdec: support RMHD file format Peter Ross
2024-03-02 23:37 ` [FFmpeg-devel] [PATCH 2/3] avcodec/rv60: RealVideo 6.0 decoder Peter Ross
2024-03-03  7:55   ` Andreas Rheinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=169805609212.23937.3884949016595644745@lain.khirnov.net \
    --to=anton@khirnov.net \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git