Browse Source

Fix regression test failure with pthreads on multiprocessor systems.

Fixes issue517

Originally committed as revision 15976 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Michael Niedermayer 17 years ago
parent
commit
a6f2c0d6e5
3 changed files with 5 additions and 2 deletions
  1. +0
    -2
      libavcodec/motion_est.c
  2. +3
    -0
      libavcodec/mpegvideo.c
  3. +2
    -0
      libavcodec/snow.c

+ 0
- 2
libavcodec/motion_est.c View File

@@ -307,8 +307,6 @@ int ff_init_me(MpegEncContext *s){
c->sub_motion_search= no_sub_motion_search; c->sub_motion_search= no_sub_motion_search;
} }


c->temp= c->scratchpad;

return 0; return 0;
} }




+ 3
- 0
libavcodec/mpegvideo.c View File

@@ -289,6 +289,7 @@ static int init_duplicate_context(MpegEncContext *s, MpegEncContext *base){


//FIXME should be linesize instead of s->width*2 but that is not known before get_buffer() //FIXME should be linesize instead of s->width*2 but that is not known before get_buffer()
CHECKED_ALLOCZ(s->me.scratchpad, (s->width+64)*4*16*2*sizeof(uint8_t)) CHECKED_ALLOCZ(s->me.scratchpad, (s->width+64)*4*16*2*sizeof(uint8_t))
s->me.temp= s->me.scratchpad;
s->rd_scratchpad= s->me.scratchpad; s->rd_scratchpad= s->me.scratchpad;
s->b_scratchpad= s->me.scratchpad; s->b_scratchpad= s->me.scratchpad;
s->obmc_scratchpad= s->me.scratchpad + 16; s->obmc_scratchpad= s->me.scratchpad + 16;
@@ -315,6 +316,7 @@ static void free_duplicate_context(MpegEncContext *s){


av_freep(&s->allocated_edge_emu_buffer); s->edge_emu_buffer= NULL; av_freep(&s->allocated_edge_emu_buffer); s->edge_emu_buffer= NULL;
av_freep(&s->me.scratchpad); av_freep(&s->me.scratchpad);
s->me.temp=
s->rd_scratchpad= s->rd_scratchpad=
s->b_scratchpad= s->b_scratchpad=
s->obmc_scratchpad= NULL; s->obmc_scratchpad= NULL;
@@ -331,6 +333,7 @@ static void backup_duplicate_context(MpegEncContext *bak, MpegEncContext *src){
COPY(allocated_edge_emu_buffer); COPY(allocated_edge_emu_buffer);
COPY(edge_emu_buffer); COPY(edge_emu_buffer);
COPY(me.scratchpad); COPY(me.scratchpad);
COPY(me.temp);
COPY(rd_scratchpad); COPY(rd_scratchpad);
COPY(b_scratchpad); COPY(b_scratchpad);
COPY(obmc_scratchpad); COPY(obmc_scratchpad);


+ 2
- 0
libavcodec/snow.c View File

@@ -4007,6 +4007,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
s->m.flags = avctx->flags; s->m.flags = avctx->flags;
s->m.bit_rate= avctx->bit_rate; s->m.bit_rate= avctx->bit_rate;


s->m.me.temp =
s->m.me.scratchpad= av_mallocz((avctx->width+64)*2*16*2*sizeof(uint8_t)); s->m.me.scratchpad= av_mallocz((avctx->width+64)*2*16*2*sizeof(uint8_t));
s->m.me.map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t)); s->m.me.map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t));
s->m.me.score_map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t)); s->m.me.score_map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t));
@@ -4435,6 +4436,7 @@ static av_cold void common_end(SnowContext *s){
av_freep(&s->spatial_dwt_buffer); av_freep(&s->spatial_dwt_buffer);
av_freep(&s->spatial_idwt_buffer); av_freep(&s->spatial_idwt_buffer);


s->m.me.temp= NULL;
av_freep(&s->m.me.scratchpad); av_freep(&s->m.me.scratchpad);
av_freep(&s->m.me.map); av_freep(&s->m.me.map);
av_freep(&s->m.me.score_map); av_freep(&s->m.me.score_map);


Loading…
Cancel
Save