[FFmpeg-devel] [PATCH] h264 parallelized

Michael Niedermayer michaelni
Tue Sep 4 01:41:07 CEST 2007


Hi

On Mon, Sep 03, 2007 at 09:32:40PM +0200, Andreas ?man wrote:
> Hi,
>
> Michael Niedermayer wrote:
>> Hi
>> ok, but what about returning some specific error code for 
>> decode_slice_header()
>> and then just redecoding that slice with context 0 ?
>
> Yes, this turned out to be a bit slimmer than I thought initially.
>

[...]
> @@ -7057,7 +7166,7 @@
>      }
>  }
>  
> -static int decode_slice(H264Context *h){
> +static int decode_slice(struct AVCodecContext *avctx, H264Context *h){
>      MpegEncContext * const s = &h->s;
>      const int part_mask= s->partitioned_frame ? (AC_END|AC_ERROR) : 0x7F;
>  
> @@ -7702,10 +7811,46 @@
>      return 0;
>  }

why that? doesnt seem like avctx is used?


[...]
>  
> Index: libavcodec/h264.h
> ===================================================================
> --- libavcodec/h264.h	(revision 10279)
> +++ libavcodec/h264.h	(working copy)
> @@ -382,6 +382,19 @@
>      const uint8_t *field_scan8x8_cavlc_q0;
>  
>      int x264_build;
> +
> +    /**
> +     * Multi threading members.
> +     * These are only used in the "master" context
> +     */

as already said, comments which apply to several fields (like all the
fields below not just thread_context) have a different syntax, and yes
id mention the syntax if id remember it but i dont, maybe it was @{ and @}
but iam not sure


> +
> +    struct H264Context *thread_context[MAX_THREADS];
> +

> +    int current_context;

this doesnt need to be in here, a local int current_context which is passed 
as argument to execute_decode_slices(, int context_count)
would do and be cleaner


> +    int current_slice;

///< current slice number, used to initalize slice_num of each thread/context



> +    int max_contexts;           ///< Max # of contexts to execute in parallel, is reduced to 1 if deblocking_filter == 1

/**
 * Max # of threads / contexts.
 * this is equal to AVCodecContext.thread_count unless multithreaded decoding
 * is impossible, in which case its reduced to 1
 */
int max_contexts;


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

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- 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/20070904/68a60a5f/attachment.pgp>



More information about the ffmpeg-devel mailing list