[MPlayer-cvslog] r32834 - in trunk/libmpcodecs: vf_perspective.c vf_pp7.c vf_sab.c

michael subversion at mplayerhq.hu
Sun Jan 30 23:57:16 CET 2011


Author: michael
Date: Sun Jan 30 23:57:16 2011
New Revision: 32834

Log:
Replace memalign() by av_malloc() in libmpcodecs. as it is not available in all platforms
ported from ffmpeg

Modified:
   trunk/libmpcodecs/vf_perspective.c
   trunk/libmpcodecs/vf_pp7.c
   trunk/libmpcodecs/vf_sab.c

Modified: trunk/libmpcodecs/vf_perspective.c
==============================================================================
--- trunk/libmpcodecs/vf_perspective.c	Sun Jan 30 11:40:08 2011	(r32833)
+++ trunk/libmpcodecs/vf_perspective.c	Sun Jan 30 23:57:16 2011	(r32834)
@@ -108,7 +108,7 @@ static int config(struct vf_instance *vf
     int i, j;
 
     vf->priv->pvStride= width;
-    vf->priv->pv= (void*)memalign(8, width*height*2*sizeof(int32_t));
+    vf->priv->pv= av_malloc(width*height*2*sizeof(int32_t));
     initPv(vf->priv, width, height);
 
     for(i=0; i<SUB_PIXELS; i++){
@@ -132,7 +132,7 @@ static int config(struct vf_instance *vf
 static void uninit(struct vf_instance *vf){
     if(!vf->priv) return;
 
-    free(vf->priv->pv);
+    av_free(vf->priv->pv);
     vf->priv->pv= NULL;
 
     free(vf->priv);

Modified: trunk/libmpcodecs/vf_pp7.c
==============================================================================
--- trunk/libmpcodecs/vf_pp7.c	Sun Jan 30 11:40:08 2011	(r32833)
+++ trunk/libmpcodecs/vf_pp7.c	Sun Jan 30 23:57:16 2011	(r32834)
@@ -350,7 +350,7 @@ static int config(struct vf_instance *vf
     int h= (height+16+15)&(~15);
 
     vf->priv->temp_stride= (width+16+15)&(~15);
-    vf->priv->src = memalign(8, vf->priv->temp_stride*(h+8)*sizeof(uint8_t));
+    vf->priv->src = av_malloc(vf->priv->temp_stride*(h+8)*sizeof(uint8_t));
 
     return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
 }
@@ -410,7 +410,7 @@ static int put_image(struct vf_instance 
 static void uninit(struct vf_instance *vf){
     if(!vf->priv) return;
 
-    free(vf->priv->src);
+    av_free(vf->priv->src);
     vf->priv->src= NULL;
 
     free(vf->priv);

Modified: trunk/libmpcodecs/vf_sab.c
==============================================================================
--- trunk/libmpcodecs/vf_sab.c	Sun Jan 30 11:40:08 2011	(r32833)
+++ trunk/libmpcodecs/vf_sab.c	Sun Jan 30 23:57:16 2011	(r32834)
@@ -95,7 +95,7 @@ static int allocStuff(FilterParam *f, in
     SwsVector *vec;
     SwsFilter swsF;
     int i,x,y;
-    f->preFilterBuf= (uint8_t*)memalign(8, stride*height);
+    f->preFilterBuf= av_malloc(stride*height);
     f->preFilterStride= stride;
 
     vec = sws_getGaussianVec(f->preFilterRadius, f->quality);
@@ -119,7 +119,7 @@ static int allocStuff(FilterParam *f, in
     vec = sws_getGaussianVec(f->radius, f->quality);
     f->distWidth= vec->length;
     f->distStride= (vec->length+7)&~7;
-    f->distCoeff= (int32_t*)memalign(8, f->distWidth*f->distStride*sizeof(int32_t));
+    f->distCoeff= av_malloc(f->distWidth*f->distStride*sizeof(int32_t));
 
     for(y=0; y<vec->length; y++){
         for(x=0; x<vec->length; x++){
@@ -153,10 +153,10 @@ static void freeBuffers(FilterParam *f){
     if(f->preFilterContext) sws_freeContext(f->preFilterContext);
     f->preFilterContext=NULL;
 
-    free(f->preFilterBuf);
+    av_free(f->preFilterBuf);
     f->preFilterBuf=NULL;
 
-    free(f->distCoeff);
+    av_free(f->distCoeff);
     f->distCoeff=NULL;
 }
 


More information about the MPlayer-cvslog mailing list