changeset 21481:95c9f47c1cd8

pre-store in bff_mask the correct or-mask to be saved in the pce (slightly faster)
author nicodvb
date Mon, 04 Dec 2006 20:38:46 +0000
parents 5ddabe489412
children 1dd284e31549
files libmpdemux/muxer_mpeg.c
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/muxer_mpeg.c	Mon Dec 04 20:28:27 2006 +0000
+++ b/libmpdemux/muxer_mpeg.c	Mon Dec 04 20:38:46 2006 +0000
@@ -1670,9 +1670,7 @@
 	}
 	else if(vpriv->telecine == TELECINE_DGPULLDOWN)
 	{
-		tff = (bff_mask[vpriv->display_frame % MAX_PATTERN_LENGTH] & 0x2) ? 0x80 : 0;
-		rff = (bff_mask[vpriv->display_frame % MAX_PATTERN_LENGTH] & 0x1) ? 0x02 : 0;
-		pce_ptr[3] = (pce_ptr[3] & 0xfd) | tff | rff;
+		pce_ptr[3] = (pce_ptr[3] & 0xfd) | bff_mask[vpriv->display_frame % MAX_PATTERN_LENGTH];
 	}
 	else
 	{
@@ -2549,6 +2547,7 @@
 {
 	unsigned int i, trfp;
 	uint64_t dfl,tfl;
+	unsigned char ormask[4] = {0x0, 0x2, 0x80, 0x82};
 	
 	dfl = (target - source) << 1;
 	tfl = source >> 1;
@@ -2560,11 +2559,11 @@
 		if(tfl >= source)
 		{
 			tfl -= source;
-			bff_mask[i] = trfp + 1;
+			bff_mask[i] = ormask[trfp + 1];
 			trfp ^= 2;
 		}
 		else
-			bff_mask[i] = trfp;
+			bff_mask[i] = ormask[trfp];
 	}
 }