|
|
|
@@ -377,8 +377,7 @@ static int init_duplicate_context(MpegEncContext *s, MpegEncContext *base){ |
|
|
|
int i; |
|
|
|
|
|
|
|
// edge emu needs blocksize + filter length - 1 (=17x17 for halfpel / 21x21 for h264) |
|
|
|
FF_ALLOCZ_OR_GOTO(s->avctx, s->allocated_edge_emu_buffer, (s->width+64)*2*21*2, fail); //(width + edge + align)*interlaced*MBsize*tolerance |
|
|
|
s->edge_emu_buffer= s->allocated_edge_emu_buffer + (s->width+64)*2*21; |
|
|
|
FF_ALLOCZ_OR_GOTO(s->avctx, s->edge_emu_buffer, (s->width+64)*2*21*2, fail); //(width + edge + align)*interlaced*MBsize*tolerance |
|
|
|
|
|
|
|
//FIXME should be linesize instead of s->width*2 but that is not known before get_buffer() |
|
|
|
FF_ALLOCZ_OR_GOTO(s->avctx, s->me.scratchpad, (s->width+64)*4*16*2*sizeof(uint8_t), fail) |
|
|
|
@@ -416,7 +415,7 @@ fail: |
|
|
|
static void free_duplicate_context(MpegEncContext *s){ |
|
|
|
if(s==NULL) return; |
|
|
|
|
|
|
|
av_freep(&s->allocated_edge_emu_buffer); s->edge_emu_buffer= NULL; |
|
|
|
av_freep(&s->edge_emu_buffer); |
|
|
|
av_freep(&s->me.scratchpad); |
|
|
|
s->me.temp= |
|
|
|
s->rd_scratchpad= |
|
|
|
@@ -433,7 +432,6 @@ static void free_duplicate_context(MpegEncContext *s){ |
|
|
|
|
|
|
|
static void backup_duplicate_context(MpegEncContext *bak, MpegEncContext *src){ |
|
|
|
#define COPY(a) bak->a= src->a |
|
|
|
COPY(allocated_edge_emu_buffer); |
|
|
|
COPY(edge_emu_buffer); |
|
|
|
COPY(me.scratchpad); |
|
|
|
COPY(me.temp); |
|
|
|
|