[FFmpeg-devel] [PATCH] h264 parallelized

Andreas Öman andreas
Mon Sep 3 11:02:27 CEST 2007


Hi again

Michael Niedermayer wrote:
> Hi
> 
>> +            hx->s.error_count = 0;
>> +        }
>> +
>> +        avctx->execute(avctx, (void *)decode_slice, (void **)h->thread_context + h->first_context,
>> +                       NULL, h->current_context - h->first_context);
>> +
>> +        /* pull back stuff from slices to master context */
>> +        hx = h->thread_context[h->current_context - 1];
>> +        s->mb_x = hx->s.mb_x;
>> +        s->mb_y = hx->s.mb_y;
>> +        for(i = 1; i < h->current_context; i++)
>> +            h->s.error_count += h->thread_context[i]->s.error_count;
>> +    }
>> +    if(reset) {
>> +        h->current_context = 0;
>> +        h->first_context = 0;
>> +    } else {
>> +        /* if currently decoding a slice header / NAL unit, we cannot just set h->current_context to 0.
> 
> why not? this increases complexity alot ...
> wouldnt copying the current context to 0 work too?

I second thought, this might bloat the code more.
context 0 (master) contains a lot of stuff which is not copied
to the threads, so just copying the context back would mess
it up pretty bad. And doing a field-by-field copy is more bloated
and more error-prone IHMO.




More information about the ffmpeg-devel mailing list