History

Remove useage of memalign() from libmpcodecs, not all platforms have memalign().

Michael Niedermayer committed 15 years ago

Commit 55fa97e1 parent 609bdf83 files · +8 −8Browse files

Showing the changes to libavfilter/libmpcodecs (3 of 3 files). Show all

Unified · Split

3 files
  1. libavfilter/libmpcodecs/vf_perspective.c +2 −2
  2. libavfilter/libmpcodecs/vf_pp7.c +2 −2
  3. libavfilter/libmpcodecs/vf_sab.c +4 −4
libavfilter/libmpcodecs/vf_perspective.c+2−2
@@ -108,7 +108,7 @@ static int config(struct vf_instance *vf, · 107 unmodified lines
108108 int i, j;
109109
110110 vf->priv->pvStride= width;
111− vf->priv->pv= (void*)memalign(8, width*height*2*sizeof(int32_t));
111+ vf->priv->pv= av_malloc(width*height*2*sizeof(int32_t));
112112 initPv(vf->priv, width, height);
113113
114114 for(i=0; i<SUB_PIXELS; i++){
@@ -132,7 +132,7 @@ static int config(struct vf_instance *vf, · 17 unmodified lines
132132 static void uninit(struct vf_instance *vf){
133133 if(!vf->priv) return;
134134
135− free(vf->priv->pv);
135+ av_free(vf->priv->pv);
136136 vf->priv->pv= NULL;
137137
138138 free(vf->priv);
libavfilter/libmpcodecs/vf_pp7.c+2−2
@@ -350,7 +350,7 @@ static int config(struct vf_instance *vf, · 349 unmodified lines
350350 int h= (height+16+15)&(~15);
351351
352352 vf->priv->temp_stride= (width+16+15)&(~15);
353− vf->priv->src = memalign(8, vf->priv->temp_stride*(h+8)*sizeof(uint8_t));
353+ vf->priv->src = av_malloc(vf->priv->temp_stride*(h+8)*sizeof(uint8_t));
354354
355355 return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
356356 }
@@ -410,7 +410,7 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){ · 53 unmodified lines
410410 static void uninit(struct vf_instance *vf){
411411 if(!vf->priv) return;
412412
413− free(vf->priv->src);
413+ av_free(vf->priv->src);
414414 vf->priv->src= NULL;
415415
416416 free(vf->priv);
libavfilter/libmpcodecs/vf_sab.c+4−4
@@ -95,7 +95,7 @@ static int allocStuff(FilterParam *f, int width, int height){ · 94 unmodified lines
9595 SwsVector *vec;
9696 SwsFilter swsF;
9797 int i,x,y;
98− f->preFilterBuf= (uint8_t*)memalign(8, stride*height);
98+ f->preFilterBuf= av_malloc(stride*height);
9999 f->preFilterStride= stride;
100100
101101 vec = sws_getGaussianVec(f->preFilterRadius, f->quality);
@@ -119,7 +119,7 @@ static int allocStuff(FilterParam *f, int width, int height){ · 17 unmodified lines
119119 vec = sws_getGaussianVec(f->radius, f->quality);
120120 f->distWidth= vec->length;
121121 f->distStride= (vec->length+7)&~7;
122− f->distCoeff= (int32_t*)memalign(8, f->distWidth*f->distStride*sizeof(int32_t));
122+ f->distCoeff= av_malloc(f->distWidth*f->distStride*sizeof(int32_t));
123123
124124 for(y=0; y<vec->length; y++){
125125 for(x=0; x<vec->length; x++){
@@ -153,10 +153,10 @@ static void freeBuffers(FilterParam *f){ · 27 unmodified lines
153153 if(f->preFilterContext) sws_freeContext(f->preFilterContext);
154154 f->preFilterContext=NULL;
155155
156− free(f->preFilterBuf);
156+ av_free(f->preFilterBuf);
157157 f->preFilterBuf=NULL;
158158
159− free(f->distCoeff);
159+ av_free(f->distCoeff);
160160 f->distCoeff=NULL;
161161 }
162162

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t