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

YUV 411/422/444 support for pp
author michael
date Sun, 05 Jan 2003 19:10:42 +0000
parents 927c246f1f6d
children 804cc05a3f61
line wrap: on
line diff
--- a/libpostproc/postprocess_template.c	Sun Jan 05 17:59:26 2003 +0000
+++ b/libpostproc/postprocess_template.c	Sun Jan 05 19:10:42 2003 +0000
@@ -2663,6 +2663,9 @@
 	int i;
 #endif
 
+	const int qpHShift= isColor ? 4-c.hChromaSubSample : 4;
+	const int qpVShift= isColor ? 4-c.vChromaSubSample : 4;
+
 	//FIXME remove
 	uint64_t * const yHistogram= c.yHistogram;
 	uint8_t * const tempSrc= c.tempSrc;
@@ -2846,8 +2849,8 @@
 		uint8_t *tempBlock1= c.tempBlocks;
 		uint8_t *tempBlock2= c.tempBlocks + 8;
 #endif
-		int8_t *QPptr= isColor ? &QPs[(y>>3)*QPStride] :&QPs[(y>>4)*QPStride];
-		int8_t *nonBQPptr= isColor ? &c.nonBQPTable[(y>>3)*mbWidth] :&c.nonBQPTable[(y>>4)*mbWidth];
+		int8_t *QPptr= &QPs[(y>>qpVShift)*QPStride];
+		int8_t *nonBQPptr= &c.nonBQPTable[(y>>qpVShift)*mbWidth];
 		int QP=0;
 		/* can we mess with a 8x16 block from srcBlock/dstBlock downwards and 1 line upwards
 		   if not than use a temporary buffer */
@@ -2886,8 +2889,8 @@
 #endif
 			if(isColor)
 			{
-				QP= QPptr[x>>3];
-				c.nonBQP= nonBQPptr[x>>3];
+				QP= QPptr[x>>qpHShift];
+				c.nonBQP= nonBQPptr[x>>qpHShift];
 			}
 			else
 			{