[FFmpeg-devel] [PATCH] h264 parallelized

Andreas Öman andreas
Tue Sep 4 14:35:49 CEST 2007


Michael Niedermayer wrote:
>> -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?

Perhaps this is a bit ugly, but is required since decode_slice()
is used as callback directly fed into avctx->execute()

avctx->execute(avctx, (void *)decode_slice, (void **)h->thread_context, 
NULL, nctxs);

A better (?) way is perhaps to cast to the correct type.

avctx->execute(avctx, (int (*)(struct AVCodecContext *, void 
*))decode_slice, (void **)h->thread_context, NULL, nctxs);

A third way is of course to create a stub-function with correct
prototype that just calls decode_slice() with correct

What say you?

More information about the ffmpeg-devel mailing list