[FFmpeg-devel] [PATCH] pthreads: export the delay that was previously exported by mangling has_b_frames through AVCodecContext.delay

Michael Niedermayer michaelni at gmx.at
Thu Nov 10 15:35:24 CET 2011


On Wed, Nov 09, 2011 at 08:42:24PM +0100, Michael Niedermayer wrote:
> On Wed, Nov 09, 2011 at 08:19:37PM +0100, Reimar Döffinger wrote:
> > On Wed, Nov 09, 2011 at 08:09:14PM +0100, Michael Niedermayer wrote:
> > > On Wed, Nov 09, 2011 at 08:05:26PM +0100, Reimar Döffinger wrote:
> > > > On Wed, Nov 09, 2011 at 07:06:08PM +0100, Michael Niedermayer wrote:
> > > > > Hi
> > > > > 
> > > > > patch below maybe usefull to applications which want to know the
> > > > > thread count used in frame multitherading.
> > > > > mplayer & mplayer2 fall in this category possibly.
> > > > 
> > > > I don't think mplayer2 is (generally) affected actually.
> > > > 
> > > > > From bd352d408af3928d9c53f4cea6a44a0797542cf1 Mon Sep 17 00:00:00 2001
> > > > > From: Michael Niedermayer <michaelni at gmx.at>
> > > > > Date: Wed, 9 Nov 2011 18:32:38 +0100
> > > > > Subject: [PATCH] pthreads: export the delay that was previously exported by mangling has_b_frames through
> > > > >  AVCodecContext.delay which was previously unused for decoders and fits better.
> > > > > 
> > > > > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > > > > ---
> > > > >  libavcodec/pthread.c |    1 +
> > > > >  libavcodec/version.h |    2 +-
> > > > >  2 files changed, 2 insertions(+), 1 deletions(-)
> > > > > 
> > > > > diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
> > > > > index 4a44cea..04181e2 100644
> > > > > --- a/libavcodec/pthread.c
> > > > > +++ b/libavcodec/pthread.c
> > > > > @@ -363,6 +363,7 @@ static int update_context_from_thread(AVCodecContext *dst, AVCodecContext *src,
> > > > >      }
> > > > >  
> > > > >      if (for_user) {
> > > > > +        dst->delay         = src->thread_count - 1;
> > > > 
> > > > Well, if set like this it should probably include a change to the
> > > > description that for decode it is the delay added due to decoding
> > > > _beyond_ the reorder delay.
> > > 
> > > I can set it to anything that people prefer but this way
> > > delay + has_b_frames would give the old value for both ffmpeg and
> > > libav.
> > 
> > No, I think this way is better for this reason and it's logical enough.
> > I just realized that IMO the description even for encode is impossible
> > to understand.
> > Not sure if it is completely correct, but this would be my suggestion
> > for the updated text:
> 
> >      * Encoding: Number of frames decode delay inherent in the chosen encoding
> >      * method (e.g. reorder delay).
> 
> this isnt correct
> the value is the delay you get from encoder+reference decoder compared
> to passing things through directly

commited something that i hope is understandable & correct
improvments welcome of course

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111110/91e4085c/attachment.asc>


More information about the ffmpeg-devel mailing list