diff libpostproc/postprocess.c @ 957:8a95bda80fdc libavcodec

YUV 411/422/444 support for pp
author michael
date Sun, 05 Jan 2003 19:10:42 +0000
parents 04fd733c5e4b
children 804cc05a3f61
line wrap: on
line diff
--- a/libpostproc/postprocess.c	Sun Jan 05 17:59:26 2003 +0000
+++ b/libpostproc/postprocess.c	Sun Jan 05 19:10:42 2003 +0000
@@ -753,6 +753,13 @@
         
 	memset(c, 0, sizeof(PPContext));
 	c->cpuCaps= cpuCaps;
+	if(cpuCaps&PP_FORMAT){
+		c->hChromaSubSample= cpuCaps&0x3;
+		c->vChromaSubSample= (cpuCaps>>4)&0x3;
+	}else{
+		c->hChromaSubSample= 1;
+		c->vChromaSubSample= 1;
+	}
 
 	reallocBuffers(c, width, height, stride);
         
@@ -795,7 +802,6 @@
 	
 	if(c->stride < minStride)
 		reallocBuffers(c, width, height, minStride);
-        
 
 	if(QP_store==NULL || (mode->lumMode & FORCE_QUANT)) 
 	{
@@ -840,8 +846,8 @@
 	postProcess(src[0], srcStride[0], dst[0], dstStride[0],
 		width, height, QP_store, QPStride, 0, mode, c);
 
-	width  = (width +1)>>1;
-	height = (height+1)>>1;
+	width  = (width )>>c->hChromaSubSample;
+	height = (height)>>c->vChromaSubSample;
 
 	if(mode->chromMode)
 	{