public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: 'Sakari Ailus' <sakari.ailus@iki.fi>
To: Kamil Debski <k.debski@samsung.com>
Cc: "'Mauro Carvalho Chehab'" <mchehab@redhat.com>,
	linux-media@vger.kernel.org,
	"'Laurent Pinchart'" <laurent.pinchart@ideasonboard.com>,
	"'Sebastian Dröge'" <sebastian.droege@collabora.co.uk>,
	"Sylwester Nawrocki" <s.nawrocki@samsung.com>,
	"Marek Szyprowski" <m.szyprowski@samsung.com>
Subject: Re: [RFC] Resolution change support in video codecs in v4l2
Date: Thu, 12 Jan 2012 00:30:46 +0200	[thread overview]
Message-ID: <20120111223045.GS9323@valkosipuli.localdomain> (raw)
In-Reply-To: <009b01cccaca$4e9a2070$ebce6150$%debski@samsung.com>

Hi Kamil,

On Wed, Jan 04, 2012 at 11:19:08AM +0100, Kamil Debski wrote:
...
> > > This takes care of the delay related problems by requiring more buffers.
> > > You have an initial delay then the frames are returned with a constant
> > rate.
> > >
> > > Dequeuing of any frame will be delayed until it is no longer used - it
> > doesn't
> > > matter whether it is a key (I) frame, P frame o r a B frame. Actually B
> > frames
> > > shouldn't be used as reference. Usually a frame is referencing only 2-3
> > previous
> > > and maybe 1 ahead (for B-frames) frames and they don't need to be I-frames.
> > Still
> > > the interval between I-frames may be 16 or even many, many, more.
> > 
> > Considering it can be 16 or even more, I see even more reason in returning
> > frames when hardware only reads them.
> 
> It can be 31337 P-frames after an I-frame but it doesn't matter, as the codec
> will never ever need more than X frames for reference. Usually the X is small, 
> like 2-3. I have never seen a number as high as 16. After this X frames are
> processed
> and kept it will allow to dequeue frames with no additional delay.
> This is a CONSTANT delay. 

It's constant, and you need up to that number more frames available for
decoding. There's no way around it.

> P-frames are equally good as reference as I-frames. No need to keep the I-frame
> for an indefinite time.
> 
> In other words: interval between I-frames is NOT the number of buffers that
> have to be kept as reference.

Referring to what Wikipedia has to say about H.264:

	Using previously-encoded pictures as references in a much more
	flexible way than in past standards, allowing up to 16 reference
	frames (or 32 reference fields, in the case of interlaced encoding)
	to be used in some cases. This is in contrast to prior standards,
	where the limit was typically one; or, in the case of conventional
	"B pictures", two. This particular feature usually allows modest
	improvements in bit rate and quality in most scenes. But in certain
	types of scenes, such as those with repetitive motion or
	back-and-forth scene cuts or uncovered background areas, it allows a
	significant reduction in bit rate while maintaining clarity.

<URL:http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC>

We need to be prepared to the worst case, which, according to this, is 16.

Regards,

-- 
Sakari Ailus
e-mail: sakari.ailus@iki.fi	jabber/XMPP/Gmail: sailus@retiisi.org.uk

  reply	other threads:[~2012-01-11 22:30 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-02 10:31 [RFC] Resolution change support in video codecs in v4l2 Kamil Debski
2011-12-02 12:35 ` Mauro Carvalho Chehab
2011-12-02 13:57   ` Sakari Ailus
2011-12-02 15:41     ` Kamil Debski
2011-12-02 17:07       ` Mauro Carvalho Chehab
2011-12-02 17:32         ` Kamil Debski
2011-12-02 18:09           ` Mauro Carvalho Chehab
2011-12-06 12:00           ` Laurent Pinchart
2011-12-06 14:28             ` 'Sakari Ailus'
2011-12-06 14:41               ` Mauro Carvalho Chehab
2011-12-06 15:19                 ` Kamil Debski
2011-12-06 15:40                   ` Mauro Carvalho Chehab
2011-12-06 16:11                     ` Kamil Debski
2011-12-06 16:39                       ` Mauro Carvalho Chehab
2011-12-07 11:49                         ` Kamil Debski
2011-12-10  9:17                         ` 'Sakari Ailus'
2011-12-12 11:11                     ` Laurent Pinchart
2011-12-03  0:08         ` 'Sakari Ailus'
2011-12-05 13:01           ` Mauro Carvalho Chehab
2011-12-02 16:50     ` Mauro Carvalho Chehab
2011-12-06 14:35       ` Sakari Ailus
2011-12-06 15:03         ` Kamil Debski
2011-12-09 19:54           ` 'Sakari Ailus'
2011-12-12 10:17             ` Kamil Debski
2012-01-01 22:29               ` 'Sakari Ailus'
2012-01-04 10:19                 ` Kamil Debski
2012-01-11 22:30                   ` 'Sakari Ailus' [this message]
2011-12-12 10:59           ` Laurent Pinchart
2011-12-12 11:09             ` Kamil Debski
2011-12-06 16:20         ` Mauro Carvalho Chehab
2011-12-06 22:41           ` Sakari Ailus
2011-12-07 11:12             ` Kamil Debski
2011-12-09 19:58               ` 'Sakari Ailus'

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=20120111223045.GS9323@valkosipuli.localdomain \
    --to=sakari.ailus@iki.fi \
    --cc=k.debski@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@redhat.com \
    --cc=s.nawrocki@samsung.com \
    --cc=sebastian.droege@collabora.co.uk \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox