comparison mpeg12.c @ 8129:a9734fe0811e libavcodec

Making it easier to send arbitrary structures as work orders to MT workers
author romansh
date Wed, 12 Nov 2008 17:47:23 +0000
parents 21df17686936
children cf4d575b1982
comparison
equal deleted inserted replaced
8128:e2241dd85c65 8129:a9734fe0811e
1864 //printf("y %d %d %d %d\n", s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y); 1864 //printf("y %d %d %d %d\n", s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y);
1865 return 0; 1865 return 0;
1866 } 1866 }
1867 1867
1868 static int slice_decode_thread(AVCodecContext *c, void *arg){ 1868 static int slice_decode_thread(AVCodecContext *c, void *arg){
1869 MpegEncContext *s= arg; 1869 MpegEncContext *s= *(void**)arg;
1870 const uint8_t *buf= s->gb.buffer; 1870 const uint8_t *buf= s->gb.buffer;
1871 int mb_y= s->start_mb_y; 1871 int mb_y= s->start_mb_y;
1872 1872
1873 s->error_count= 3*(s->end_mb_y - s->start_mb_y)*s->mb_width; 1873 s->error_count= 3*(s->end_mb_y - s->start_mb_y)*s->mb_width;
1874 1874
2297 if (start_code > 0x1ff){ 2297 if (start_code > 0x1ff){
2298 if(s2->pict_type != FF_B_TYPE || avctx->skip_frame <= AVDISCARD_DEFAULT){ 2298 if(s2->pict_type != FF_B_TYPE || avctx->skip_frame <= AVDISCARD_DEFAULT){
2299 if(avctx->thread_count > 1){ 2299 if(avctx->thread_count > 1){
2300 int i; 2300 int i;
2301 2301
2302 avctx->execute(avctx, slice_decode_thread, (void**)&(s2->thread_context[0]), NULL, s->slice_count); 2302 avctx->execute(avctx, slice_decode_thread, (void**)&(s2->thread_context[0]), NULL, s->slice_count, sizeof(void*));
2303 for(i=0; i<s->slice_count; i++) 2303 for(i=0; i<s->slice_count; i++)
2304 s2->error_count += s2->thread_context[i]->error_count; 2304 s2->error_count += s2->thread_context[i]->error_count;
2305 } 2305 }
2306 if (slice_end(avctx, picture)) { 2306 if (slice_end(avctx, picture)) {
2307 if(s2->last_picture_ptr || s2->low_delay) //FIXME merge with the stuff in mpeg_decode_slice 2307 if(s2->last_picture_ptr || s2->low_delay) //FIXME merge with the stuff in mpeg_decode_slice