# HG changeset patch # User mru # Date 1227553682 0 # Node ID b9e82845e7ebc500681ff3b443121e341fc6602f # Parent e1f9d8919cb534e019aec0a0f8d75a2eaebf8c70 svq1enc: move scratch buffer from stack to context to ensure alignment diff -r e1f9d8919cb5 -r b9e82845e7eb svq1enc.c --- a/svq1enc.c Mon Nov 24 19:00:55 2008 +0000 +++ b/svq1enc.c Mon Nov 24 19:08:02 2008 +0000 @@ -67,6 +67,8 @@ int16_t (*motion_val16[3])[2]; int64_t rd_total; + + uint8_t *scratchbuf; } SVQ1Context; static void svq1_write_header(SVQ1Context *s, int frame_type) @@ -378,7 +380,7 @@ uint8_t *decoded= decoded_plane + offset; uint8_t *ref= ref_plane + offset; int score[4]={0,0,0,0}, best; - uint8_t temp[16*stride]; + uint8_t *temp = s->scratchbuf; if(s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb)>>3) < 3000){ //FIXME check size av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n"); @@ -524,6 +526,7 @@ if(!s->current_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); } temp= s->current_picture; @@ -566,6 +569,7 @@ av_freep(&s->m.me.score_map); av_freep(&s->mb_type); av_freep(&s->dummy); + av_freep(&s->scratchbuf); for(i=0; i<3; i++){ av_freep(&s->motion_val8[i]);