diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2004-10-26 12:47:56 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2004-10-26 12:47:56 +0000 |
commit | 3237f7318344f55a9397eeaa1e4536319c7a9987 (patch) | |
tree | 5956afacac0ba4af90f6ad59efdc45b5f1f0a26d /libavcodec/utils.c | |
parent | ec7eb8966c6bba4883c8c798ed14e669a71bd379 (diff) | |
download | ffmpeg-3237f7318344f55a9397eeaa1e4536319c7a9987.tar.gz |
stride align cleanup
Originally committed as revision 3640 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 05e63ae7f2..6702cd1ae8 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -219,7 +219,7 @@ int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){ buf->last_pic_num= *picture_number; }else{ int h_chroma_shift, v_chroma_shift; - int s_align, pixel_size; + int pixel_size; avcodec_get_chroma_sub_sample(s->pix_fmt, &h_chroma_shift, &v_chroma_shift); @@ -242,11 +242,6 @@ int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){ } avcodec_align_dimensions(s, &w, &h); -#if defined(ARCH_POWERPC) || defined(HAVE_MMI) //FIXME some cleaner check - s_align= 16; -#else - s_align= 8; -#endif if(!(s->flags&CODEC_FLAG_EMU_EDGE)){ w+= EDGE_WIDTH*2; @@ -260,7 +255,7 @@ int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){ const int v_shift= i==0 ? 0 : v_chroma_shift; //FIXME next ensures that linesize= 2^x uvlinesize, thats needed because some MC code assumes it - buf->linesize[i]= ALIGN(pixel_size*w>>h_shift, s_align<<(h_chroma_shift-h_shift)); + buf->linesize[i]= ALIGN(pixel_size*w>>h_shift, STRIDE_ALIGN<<(h_chroma_shift-h_shift)); buf->base[i]= av_mallocz((buf->linesize[i]*h>>v_shift)+16); //FIXME 16 if(buf->base[i]==NULL) return -1; @@ -269,7 +264,7 @@ int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){ if(s->flags&CODEC_FLAG_EMU_EDGE) buf->data[i] = buf->base[i]; else - buf->data[i] = buf->base[i] + ALIGN((buf->linesize[i]*EDGE_WIDTH>>v_shift) + (EDGE_WIDTH>>h_shift), s_align); + buf->data[i] = buf->base[i] + ALIGN((buf->linesize[i]*EDGE_WIDTH>>v_shift) + (EDGE_WIDTH>>h_shift), STRIDE_ALIGN); } pic->age= 256*256*256*64; } |