Mercurial > libavcodec.hg
comparison mpegvideo.c @ 8239:dcfdb3352dde libavcodec
Fix regression test failure with pthreads on multiprocessor systems.
Fixes issue517
author | michael |
---|---|
date | Tue, 02 Dec 2008 10:43:08 +0000 |
parents | 2b20ad98e424 |
children | cf4d575b1982 |
comparison
equal
deleted
inserted
replaced
8238:93ee77578391 | 8239:dcfdb3352dde |
---|---|
287 CHECKED_ALLOCZ(s->allocated_edge_emu_buffer, (s->width+64)*2*21*2); //(width + edge + align)*interlaced*MBsize*tolerance | 287 CHECKED_ALLOCZ(s->allocated_edge_emu_buffer, (s->width+64)*2*21*2); //(width + edge + align)*interlaced*MBsize*tolerance |
288 s->edge_emu_buffer= s->allocated_edge_emu_buffer + (s->width+64)*2*21; | 288 s->edge_emu_buffer= s->allocated_edge_emu_buffer + (s->width+64)*2*21; |
289 | 289 |
290 //FIXME should be linesize instead of s->width*2 but that is not known before get_buffer() | 290 //FIXME should be linesize instead of s->width*2 but that is not known before get_buffer() |
291 CHECKED_ALLOCZ(s->me.scratchpad, (s->width+64)*4*16*2*sizeof(uint8_t)) | 291 CHECKED_ALLOCZ(s->me.scratchpad, (s->width+64)*4*16*2*sizeof(uint8_t)) |
292 s->me.temp= s->me.scratchpad; | |
292 s->rd_scratchpad= s->me.scratchpad; | 293 s->rd_scratchpad= s->me.scratchpad; |
293 s->b_scratchpad= s->me.scratchpad; | 294 s->b_scratchpad= s->me.scratchpad; |
294 s->obmc_scratchpad= s->me.scratchpad + 16; | 295 s->obmc_scratchpad= s->me.scratchpad + 16; |
295 if (s->encoding) { | 296 if (s->encoding) { |
296 CHECKED_ALLOCZ(s->me.map , ME_MAP_SIZE*sizeof(uint32_t)) | 297 CHECKED_ALLOCZ(s->me.map , ME_MAP_SIZE*sizeof(uint32_t)) |
313 static void free_duplicate_context(MpegEncContext *s){ | 314 static void free_duplicate_context(MpegEncContext *s){ |
314 if(s==NULL) return; | 315 if(s==NULL) return; |
315 | 316 |
316 av_freep(&s->allocated_edge_emu_buffer); s->edge_emu_buffer= NULL; | 317 av_freep(&s->allocated_edge_emu_buffer); s->edge_emu_buffer= NULL; |
317 av_freep(&s->me.scratchpad); | 318 av_freep(&s->me.scratchpad); |
319 s->me.temp= | |
318 s->rd_scratchpad= | 320 s->rd_scratchpad= |
319 s->b_scratchpad= | 321 s->b_scratchpad= |
320 s->obmc_scratchpad= NULL; | 322 s->obmc_scratchpad= NULL; |
321 | 323 |
322 av_freep(&s->dct_error_sum); | 324 av_freep(&s->dct_error_sum); |
329 static void backup_duplicate_context(MpegEncContext *bak, MpegEncContext *src){ | 331 static void backup_duplicate_context(MpegEncContext *bak, MpegEncContext *src){ |
330 #define COPY(a) bak->a= src->a | 332 #define COPY(a) bak->a= src->a |
331 COPY(allocated_edge_emu_buffer); | 333 COPY(allocated_edge_emu_buffer); |
332 COPY(edge_emu_buffer); | 334 COPY(edge_emu_buffer); |
333 COPY(me.scratchpad); | 335 COPY(me.scratchpad); |
336 COPY(me.temp); | |
334 COPY(rd_scratchpad); | 337 COPY(rd_scratchpad); |
335 COPY(b_scratchpad); | 338 COPY(b_scratchpad); |
336 COPY(obmc_scratchpad); | 339 COPY(obmc_scratchpad); |
337 COPY(me.map); | 340 COPY(me.map); |
338 COPY(me.score_map); | 341 COPY(me.score_map); |