View Single Post
Old 19th September 2013, 16:07   #6  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
I did fix what I thought was a bug in FDecimate metrics, but not offhand sure exactly what it was.
I still prefer Multidecimate/MDec2 in preference to other decimators due to two pass with all metrics
simultaneously available for 2nd pass. Find it particularly preferable if fixing a clip with multiple issues,
where can do 1st pass only once and then can play with additional filters to your hearts content
without incurring decimate detection overhead whilst trying to find optimum correction settings.
Never did get to see the source though, as not released, I think, same for Multidecimate.Exe and ProcessMD.Exe.

On second thoughts, I think you did metrics in frame strips skipping some of the frame and think that
it got 'out of whack' for chroma metrics, adding chroma metrics to wrong BLOCK. I modded to examine
entire frame, and corrected what I thought was the error.

You are welcome to take what I've done and mod it further, would be very happy to try out new 1 pass multidecimate.

EDIT: MDec2(), Metrics for Planar (v2.6 compatible)
Code:
// Below, Luma *2 as luma counts 50%, same as combined chroma (U+V) [maintain precision].
	if(vi.IsPlanar()) {
		for (y = 0; y < height; ++y) {
			for (x = 0; x < row_size;++x) {
				sum[(y/BLKSIZE)*xblocks+x/BLKSIZE] += abs((int)currp[x] - (int)prevp[x]) * 2;
			}
			prevp += pitch;
			currp += pitch;
		}
		if (color) {
			prevpU = prev->GetReadPtr(PLANAR_U);
			currpU = curr->GetReadPtr(PLANAR_U);
			prevpV = prev->GetReadPtr(PLANAR_V);
			currpV = curr->GetReadPtr(PLANAR_V);
			for (y = 0; y < heightUV; ++y) {
				for (x = 0; x < row_sizeUV; ++x) {
					int sm	=	abs((int)currpU[x] - (int)prevpU[x]);
					sm		+=	abs((int)currpV[x] - (int)prevpV[x]);
					sum[((ySubS*y)/BLKSIZE)*xblocks+(xSubS*x)/BLKSIZE] += sm * tSubS;
				}
				prevpU += pitchUV;
				currpU += pitchUV;
				prevpV += pitchUV;
				currpV += pitchUV;
			}
		}
        }
EDIT: SubS stuff
Code:
	int xSubS	=1;
	int ySubS	=1;
	int tSubS	=1;
	bool color	= (chroma);

	if (vi.IsPlanar()) {
		row_sizeUV = curr->GetRowSize(PLANAR_U);
		if(color && row_sizeUV>0) {
			pitchUV		= curr->GetPitch(PLANAR_U);
			heightUV	= curr->GetHeight(PLANAR_U);
			xSubS=row_size	/ row_sizeUV;
			ySubS=height	/ heightUV;
			tSubS = xSubS * ySubS;
		} else {
			color=false;
		}
	}
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 19th September 2013 at 16:41. Reason: additional
StainlessS is offline   Reply With Quote