[FFmpeg-devel] [PATCH] simplify dnxhd threading

Michael Niedermayer michaelni
Tue Sep 29 12:33:12 CEST 2009


On Sat, Sep 26, 2009 at 02:45:25AM -0400, Alexander Strange wrote:
> On Sat, Sep 26, 2009 at 1:31 AM, Mike Melanson <mike at multimedia.cx> wrote:
> > Reimar D?ffinger wrote:
> >>
> >> On Fri, Sep 25, 2009 at 10:51:36AM -0700, Baptiste Coudurier wrote:
> >>>
> >>> 68 contexts, even when not using threads ? I'm concerned about memory.
> >>
> >> Yes, that probably should be checked. Though I think that giving each
> >> thread
> >> its own whole context is overdoing it anyway.
> >
> > Thanks for the patch. I vastly simplified the Theora multithreading
> > prototype. Instead of copying the whole VP3 context like I did when modeling
> > after the dnxhd encoder, I made a new structure that only contains a single
> > int-- the slice number to be processed. Then I submit 68 slices to the
> > thread dispatcher for processing.
> >
> > ...and it still doesn't work quite right.
> >
> > --
> > ? ?-Mike Melanson
> 
> I had these patches in an old git branch; they might help, though I
> didn't see much speed up.
> The Theora decoder spends much more time doing linear searches than it
> does actually decoding, IIRC.
> 
> And I don't mean to submit patch 4 yet, the "enc->thread_count=" lines
> should be deleted from ffplay/ffmpeg too.
> 
> (and could you look at
> http://article.gmane.org/gmane.comp.video.ffmpeg.devel/95138/?)

>  vp3.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> f2c49d7e3760f414da433e45a9f7cde52a25773b  0001-Simplify-if-statement.patch
> From ca43338324db455879716ab14a50ffa20321a64f Mon Sep 17 00:00:00 2001
> From: Alexander Strange <astrange at ithinksw.com>
> Date: Tue, 16 Jun 2009 22:01:51 -0400
> Subject: [PATCH] Simplify if statement

ok


[...]
>  vp3.c |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 072341d8287549105c8463f861cedd987668205a  0002-Dynamically-allocate-VP3-qscale_table.patch
> From 1344156080ab24b299d3e58e9ddf9a15826feb2c Mon Sep 17 00:00:00 2001
> From: Alexander Strange <astrange at ithinksw.com>
> Date: Tue, 16 Jun 2009 22:36:00 -0400
> Subject: [PATCH] Dynamically allocate VP3 qscale_table.
> 
> Note that the comment by its declaration was wrong.

missing a ==NULL


[...]

>  vp3.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 37c6e2697943f7799f298e4d7ce9de4349d9b528  0003-Dynamically-allocate-VP3-edge_emu_buffer.patch
> From e87a784ee8b29d78c63d05428e97222bedb58e15 Mon Sep 17 00:00:00 2001
> From: Alexander Strange <astrange at ithinksw.com>
> Date: Tue, 16 Jun 2009 23:03:41 -0400
> Subject: [PATCH] Dynamically allocate VP3 edge_emu_buffer.
> 
> Using 9*linesize caused some valgrind warnings (read 8 bytes past
> the end).

id like to hear more than "it read over it so i increased it" ...
also ==NULL missing

[...]

>  ffplay.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 1bd50c8a9b95f00a96119042c4aa3f5c1280bc21  0004-Call-avcodec_thread_init-before-avcodec_open.patch
> From 2e67f99a08c8a113a79c4fa0044b7d87e4d97d6e Mon Sep 17 00:00:00 2001
> From: Alexander Strange <astrange at ithinksw.com>
> Date: Wed, 17 Jun 2009 00:49:51 -0400
> Subject: [PATCH] Call avcodec_thread_init() before avcodec_open().
> 
> The current order is nonsense, decoders should see thread_count
> in their init function.

looks good, if it has been tested (tested== made sure threaded decoding still
works)


[...]
-- 
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: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090929/5decf8e0/attachment.pgp>



More information about the ffmpeg-devel mailing list