[Mplayer-cvslog] CVS: main/libmpcodecs vf_sab.c,1.1,1.2 vf_scale.c,1.32,1.33 vf_smartblur.c,1.2,1.3

Michael Niedermayer CVS michael at mplayerhq.hu
Sun Feb 23 23:06:26 CET 2003


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv23109/libmpcodecs

Modified Files:
	vf_sab.c vf_scale.c vf_smartblur.c 
Log Message:
sws_ prefix, more seperation between internal & external swscaler API
sws_scale() returns the number of outputed lines


Index: vf_sab.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_sab.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- vf_sab.c	4 Nov 2002 16:41:59 -0000	1.1
+++ vf_sab.c	23 Feb 2003 22:05:52 -0000	1.2
@@ -43,7 +43,7 @@
 	float preFilterRadius;
 	float strength;
 	float quality;
-	SwsContext *preFilterContext;
+	struct SwsContext *preFilterContext;
 	uint8_t *preFilterBuf;
 	int preFilterStride;
 	int distWidth;
@@ -95,14 +95,14 @@
 	f->preFilterBuf= (uint8_t*)memalign(8, stride*height);
 	f->preFilterStride= stride;
 
-	vec = getGaussianVec(f->preFilterRadius, f->quality);
+	vec = sws_getGaussianVec(f->preFilterRadius, f->quality);
 	swsF.lumH= swsF.lumV= vec;
 	swsF.chrH= swsF.chrV= NULL;
-	f->preFilterContext= getSwsContext(
+	f->preFilterContext= sws_getContext(
 		width, height, IMGFMT_Y8, width, height, IMGFMT_Y8, 0, &swsF, NULL);
 	
-	freeVec(vec);
-	vec = getGaussianVec(f->strength, 5.0);
+	sws_freeVec(vec);
+	vec = sws_getGaussianVec(f->strength, 5.0);
 	for(i=0; i<512; i++){
 		double d;
 		int index= i-256 + vec->length/2;
@@ -112,8 +112,8 @@
 		
 		f->colorDiffCoeff[i]= (int)(d/vec->coeff[vec->length/2]*(1<<12) + 0.5);
 	}
-	freeVec(vec);
-	vec = getGaussianVec(f->radius, f->quality);
+	sws_freeVec(vec);
+	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));
@@ -127,7 +127,7 @@
 //				printf("%6d ", f->distCoeff[x + y*f->distStride]);
 		}
 	}
-	freeVec(vec);
+	sws_freeVec(vec);
 	
 	return 0;
 }
@@ -147,7 +147,7 @@
 }
 
 static void freeBuffers(FilterParam *f){
-	if(f->preFilterContext) freeSwsContext(f->preFilterContext);
+	if(f->preFilterContext) sws_freeContext(f->preFilterContext);
 	f->preFilterContext=NULL;
 	
 	if(f->preFilterBuf) free(f->preFilterBuf);
@@ -176,7 +176,8 @@
 	int srcStrideArray[3]= {srcStride, 0, 0};
 	int dstStrideArray[3]= {f.preFilterStride, 0, 0};
 
-	f.preFilterContext->swScale(f.preFilterContext, srcArray, srcStrideArray, 0, h, dstArray, dstStrideArray);
+//	f.preFilterContext->swScale(f.preFilterContext, srcArray, srcStrideArray, 0, h, dstArray, dstStrideArray);
+	sws_scale(f.preFilterContext, srcArray, srcStrideArray, 0, h, dstArray, dstStrideArray);
 	
 	for(y=0; y<h; y++){
 		for(x=0; x<w; x++){

Index: vf_scale.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_scale.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- vf_scale.c	23 Feb 2003 20:40:46 -0000	1.32
+++ vf_scale.c	23 Feb 2003 22:05:52 -0000	1.33
@@ -18,7 +18,7 @@
     int v_chr_drop;
     int param;
     unsigned int fmt;
-    SwsContext *ctx;
+    struct SwsContext *ctx;
     unsigned char* palette;
     mp_image_t *dmpi;
 };
@@ -148,13 +148,13 @@
 	vf->priv->w,vf->priv->h,vo_format_name(best));
 
     // free old ctx:
-    if(vf->priv->ctx) freeSwsContext(vf->priv->ctx);
+    if(vf->priv->ctx) sws_freeContext(vf->priv->ctx);
     
     // new swscaler:
-    swsGetFlagsAndFilterFromCmdLine(&int_sws_flags, &srcFilter, &dstFilter);
+    sws_getFlagsAndFilterFromCmdLine(&int_sws_flags, &srcFilter, &dstFilter);
     int_sws_flags|= vf->priv->v_chr_drop << SWS_SRC_V_CHR_DROP_SHIFT;
     int_sws_flags|= vf->priv->param      << SWS_PARAM_SHIFT;
-    vf->priv->ctx=getSwsContext(width,height,
+    vf->priv->ctx=sws_getContext(width,height,
 	    (outfmt==IMGFMT_I420 || outfmt==IMGFMT_IYUV)?IMGFMT_YV12:outfmt,
 		  vf->priv->w,vf->priv->h,
 	    (best==IMGFMT_I420 || best==IMGFMT_IYUV)?IMGFMT_YV12:best,
@@ -218,7 +218,7 @@
 	return;
     }
 //    printf("vf_scale::draw_slice() y=%d h=%d\n",y,h);
-    vf->priv->ctx->swScale(vf->priv->ctx,src,stride,y,h,dmpi->planes,dmpi->stride);
+    sws_scale(vf->priv->ctx,src,stride,y,h,dmpi->planes,dmpi->stride);
 }
 
 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi){
@@ -233,7 +233,7 @@
     dmpi=vf_get_image(vf->next,vf->priv->fmt,
 	MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE,
 	vf->priv->w, vf->priv->h);
-    vf->priv->ctx->swScale(vf->priv->ctx,mpi->planes,mpi->stride,0,mpi->h,dmpi->planes,dmpi->stride);
+    sws_scale(vf->priv->ctx,mpi->planes,mpi->stride,0,mpi->h,dmpi->planes,dmpi->stride);
 
   }
 

Index: vf_smartblur.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_smartblur.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- vf_smartblur.c	24 Nov 2002 06:23:50 -0000	1.2
+++ vf_smartblur.c	23 Feb 2003 22:05:52 -0000	1.3
@@ -46,7 +46,7 @@
 	float strength;
 	int threshold;
 	float quality;
-	SwsContext *filterContext;
+	struct SwsContext *filterContext;
 }FilterParam;
 
 struct vf_priv_s {
@@ -88,15 +88,15 @@
 	SwsVector *vec;
 	SwsFilter swsF;
 
-	vec = getGaussianVec(f->radius, f->quality);
-	scaleVec(vec, f->strength);
+	vec = sws_getGaussianVec(f->radius, f->quality);
+	sws_scaleVec(vec, f->strength);
 	vec->coeff[vec->length/2]+= 1.0 - f->strength;
 	swsF.lumH= swsF.lumV= vec;
 	swsF.chrH= swsF.chrV= NULL;
-	f->filterContext= getSwsContext(
+	f->filterContext= sws_getContext(
 		width, height, IMGFMT_Y8, width, height, IMGFMT_Y8, 0, &swsF, NULL);
 
-	freeVec(vec);
+	sws_freeVec(vec);
 
 	return 0;
 }
@@ -116,7 +116,7 @@
 }
 
 static void freeBuffers(FilterParam *f){
-	if(f->filterContext) freeSwsContext(f->filterContext);
+	if(f->filterContext) sws_freeContext(f->filterContext);
 	f->filterContext=NULL;
 }
 
@@ -138,7 +138,7 @@
 	int srcStrideArray[3]= {srcStride, 0, 0};
 	int dstStrideArray[3]= {dstStride, 0, 0};
 
-	f.filterContext->swScale(f.filterContext, srcArray, srcStrideArray, 0, h, dstArray, dstStrideArray);
+	sws_scale(f.filterContext, srcArray, srcStrideArray, 0, h, dstArray, dstStrideArray);
 	
 	if(f.threshold > 0){
 		for(y=0; y<h; y++){



More information about the MPlayer-cvslog mailing list