diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-04-26 18:46:18 +0300 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-04-26 18:46:18 +0300 |
commit | 9a34ae4fd05226feb5b82573a4283c3cd8586b8a (patch) | |
tree | 157e9ea076c46fe37e626704a7b81c6e8b2a6db3 /libmpcodecs/mp_image.c | |
parent | 8df340271e868252e7398307e126ea12083d426b (diff) | |
parent | 91a84df7d0b19ca510a78191233f17c2d7691b95 (diff) | |
download | mpv-9a34ae4fd05226feb5b82573a4283c3cd8586b8a.tar.bz2 mpv-9a34ae4fd05226feb5b82573a4283c3cd8586b8a.tar.xz |
Merge svn changes up to r31050
Diffstat (limited to 'libmpcodecs/mp_image.c')
-rw-r--r-- | libmpcodecs/mp_image.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libmpcodecs/mp_image.c b/libmpcodecs/mp_image.c index e71821129d..898f5fac96 100644 --- a/libmpcodecs/mp_image.c +++ b/libmpcodecs/mp_image.c @@ -30,14 +30,15 @@ #include "libmpcodecs/mp_image.h" #include "libvo/fastmemcpy.h" +#include "libavutil/mem.h" void mp_image_alloc_planes(mp_image_t *mpi) { // IF09 - allocate space for 4. plane delta info - unused if (mpi->imgfmt == IMGFMT_IF09) { - mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8+ + mpi->planes[0]=av_malloc(mpi->bpp*mpi->width*(mpi->height+2)/8+ mpi->chroma_width*mpi->chroma_height); } else - mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8); + mpi->planes[0]=av_malloc(mpi->bpp*mpi->width*(mpi->height+2)/8); if (mpi->flags&MP_IMGFLAG_PLANAR) { int bpp = IMGFMT_IS_YUVP16(mpi->imgfmt)? 2 : 1; // YV12/I420/YVU9/IF09. feel free to add other planar formats here... @@ -65,7 +66,7 @@ void mp_image_alloc_planes(mp_image_t *mpi) { } else { mpi->stride[0]=mpi->width*mpi->bpp/8; if (mpi->flags & MP_IMGFLAG_RGB_PALETTE) - mpi->planes[1] = memalign(64, 1024); + mpi->planes[1] = av_malloc(1024); } mpi->flags|=MP_IMGFLAG_ALLOCATED; } @@ -191,9 +192,9 @@ void free_mp_image(mp_image_t* mpi){ if(!mpi) return; if(mpi->flags&MP_IMGFLAG_ALLOCATED){ /* becouse we allocate the whole image in once */ - if(mpi->planes[0]) free(mpi->planes[0]); + if(mpi->planes[0]) av_free(mpi->planes[0]); if (mpi->flags & MP_IMGFLAG_RGB_PALETTE) - free(mpi->planes[1]); + av_free(mpi->planes[1]); } free(mpi); } |