# HG changeset patch # User zuxy # Date 1263287612 0 # Node ID 423410fc29b1f0832f4ce9f7dc027f501d642385 # Parent f6fc6ace95e3882e46dd80e3ea16d2b986d271a4 Reduce stack usage in svq1_encode_plane(). Reuse context scratch buffer instead. Avoid a crash on MinGW. diff -r f6fc6ace95e3 -r 423410fc29b1 svq1enc.c --- a/svq1enc.c Tue Jan 12 06:01:55 2010 +0000 +++ b/svq1enc.c Tue Jan 12 09:13:32 2010 +0000 @@ -269,6 +269,7 @@ int block_width, block_height; int level; int threshold[6]; + uint8_t *src = s->scratchbuf + stride * 16; const int lambda= (s->picture.quality*s->picture.quality) >> (2*FF_LAMBDA_SHIFT); /* figure out the acceptable level thresholds in advance */ @@ -327,8 +328,6 @@ s->m.me.dia_size= s->avctx->dia_size; s->m.first_slice_line=1; for (y = 0; y < block_height; y++) { - uint8_t src[stride*16]; - s->m.new_picture.data[0]= src - y*16*stride; //ugly s->m.mb_y= y; @@ -356,8 +355,6 @@ s->m.first_slice_line=1; for (y = 0; y < block_height; y++) { - uint8_t src[stride*16]; - for(i=0; i<16 && i + 16*ycurrent_picture.data[0]){ avctx->get_buffer(avctx, &s->current_picture); avctx->get_buffer(avctx, &s->last_picture); - s->scratchbuf = av_malloc(s->current_picture.linesize[0] * 16); + s->scratchbuf = av_malloc(s->current_picture.linesize[0] * 16 * 2); } temp= s->current_picture;