[xiph-commits] r7731 - in trunk/oggdsf: sln/oggdsf_all src/lib/codecs/theora/filters/dsfTheoraDecoder

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Fri Sep 10 05:36:41 PDT 2004


Author: illiminable
Date: 2004-09-10 05:36:40 -0700 (Fri, 10 Sep 2004)
New Revision: 7731

Modified:
   trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln
   trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp
Log:
* Fixed the buffering problem... was fixed by moving the buffer size calculations to somewhere they shouldn't be... they were there before in the previous incarnation... but i moved them when i realised that was the wrong place for them. Not really sure at this point why exactly it makes such a huge difference and why it only affects certain resolutions.

* Theora works in WMP9 and 10 now... but lacks seeking.

Modified: trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln
===================================================================
--- trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln	2004-09-10 10:08:52 UTC (rev 7730)
+++ trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln	2004-09-10 12:36:40 UTC (rev 7731)
@@ -149,7 +149,6 @@
 	ProjectSection(ProjectDependencies) = postProject
 		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
 		{A882A968-3013-4A27-B653-E18CF5C791FE} = {A882A968-3013-4A27-B653-E18CF5C791FE}
-		{A3BFBA6A-9B45-44C3-8FB0-A16FA2D9E487} = {A3BFBA6A-9B45-44C3-8FB0-A16FA2D9E487}
 		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
 		{6B20BD7A-644B-4087-9CAC-71B2D68D0231} = {6B20BD7A-644B-4087-9CAC-71B2D68D0231}
 		{053D669F-E874-44C6-9705-8A1DEF40C4E9} = {053D669F-E874-44C6-9705-8A1DEF40C4E9}

Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp	2004-09-10 10:08:52 UTC (rev 7730)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp	2004-09-10 12:36:40 UTC (rev 7731)
@@ -145,6 +145,9 @@
 	if ((CheckInputType(inInputMediaType) == S_OK) &&
 		((inOutputMediaType->majortype == MEDIATYPE_Video) && (inOutputMediaType->subtype == MEDIASUBTYPE_YV12) && (inOutputMediaType->formattype == FORMAT_VideoInfo)
 		)) {
+		VIDEOINFOHEADER* locVideoHeader = (VIDEOINFOHEADER*)inOutputMediaType->Format();
+		mHeight = (unsigned long)abs(locVideoHeader->bmiHeader.biHeight);
+		mWidth = (unsigned long)abs(locVideoHeader->bmiHeader.biWidth);
 
 	
 		return S_OK;
@@ -311,7 +314,7 @@
 
 	//CAutoLock locLock(mStreamLock);
 	debugLog<<endl<<"Transform "<<endl;
-	
+	//debugLog<<"outOutputSample Size = "<<outOutputSample->
 	HRESULT locHR;
 	BYTE* locBuff = NULL;
 	//Get a source poitner into the input buffer
@@ -389,6 +392,7 @@
 		
 		//How many UNITS does one frame take.
 		mFrameDuration = (UNITS * mTheoraFormatInfo->frameRateDenominator) / (mTheoraFormatInfo->frameRateNumerator);
+
 		mFrameSize = (mHeight * mWidth * 3) / 2;
 		mFrameCount = 0;
 		debugLog<<"Frame Durn = "<<mFrameDuration<<endl;
@@ -400,6 +404,8 @@
 	debugLog<<"y_height x width = "<<inYUVBuffer->y_height<<" x "<<inYUVBuffer->y_width<<"  ("<<inYUVBuffer->y_stride<<endl;
 	debugLog<<"uv_height x width = "<<inYUVBuffer->uv_height<<" x "<<inYUVBuffer->uv_width<<"  ("<<inYUVBuffer->y_stride<<endl;
 
+	debugLog<<"mWidth x mHeight = "<<mWidth<<" x "<<mHeight<<endl;
+	debugLog<<"mFrameSize = "<<mFrameSize<<endl;
 	debugLog<<"Offsets x,y = "<<mXOffset<<", "<<mYOffset<<endl;
 	////FIX::: Most of this will be obselete... the demux does it all.
 	//
@@ -446,9 +452,8 @@
 	//REFERENCE_TIME locFrameEnd = CurrentStartTime() + (mFrameCount * mFrameDuration);
 	REFERENCE_TIME locFrameEnd = locTimeBase + (mFrameCount * mFrameDuration);
 
-	DbgLog((LOG_TRACE,1,TEXT("Frame Runs From %d"), locFrameStart));
-	DbgLog((LOG_TRACE,1,TEXT("Frame Runs To %d"), locFrameEnd));
 
+
 	
 	debugLog<<"Sample times = "<<locFrameStart<<" to "<<locFrameEnd<<endl;
 	
@@ -499,6 +504,7 @@
 	////Make our pointers set to point to the samples buffer
 	outSample->GetPointer(&locBuffer);
 	
+	
 
 
 	//Fill the buffer with yuv data...
@@ -510,19 +516,24 @@
 	unsigned char* locDestUptoPtr = locBuffer;
 	char* locSourceUptoPtr = inYUVBuffer->y;
 
-	//Strides from theora are generally -'ve so absolutise them.
-	unsigned long locYStride = inYUVBuffer->y_stride;
-	unsigned long locUVStride = inYUVBuffer->uv_stride;
+	//Strides from theora are generally -'ve
+	long locYStride = inYUVBuffer->y_stride;
+	long locUVStride = inYUVBuffer->uv_stride;
 
+	debugLog<<"Y Stride = "<<locYStride<<endl;
+	debugLog<<"UV Stride = "<<locUVStride<<endl;
 	//
 	//Y DATA
 	//
 
 	//NEW WAY with offsets Y Data
 	long locTopPad = inYUVBuffer->y_height - mHeight - mYOffset;
+	debugLog<<"--------- PAD = "<<locTopPad<<endl;
 	ASSERT(locTopPad >= 0);
 	if (locTopPad < 0) {
 		locTopPad = 0;
+	} else {
+		
 	}
 
 	//Skip the top padding
@@ -536,6 +547,8 @@
 
 	locSourceUptoPtr += (mYOffset * locYStride);
 
+	debugLog<<"Dest Distance(y) = "<<(unsigned long)(locDestUptoPtr - locBuffer)<<endl;
+
 	//Source advances by (y_height * y_stride)
 	//Dest advances by (mHeight * mWidth)
 
@@ -565,6 +578,7 @@
 	//Dest advances by (mHeight * mWidth) /4
 
 
+	debugLog<<"Dest Distance(V) = "<<(unsigned long)(locDestUptoPtr - locBuffer)<<endl;
 	//
 	//U DATA
 	//
@@ -581,8 +595,9 @@
 	}
 	locSourceUptoPtr += ((mYOffset/2) * locUVStride);
 
+	debugLog<<"Dest Distance(U) = "<<(unsigned long)(locDestUptoPtr - locBuffer)<<endl;
+	debugLog<<"Frame Size = "<<mFrameSize<<endl;
 
-
 	//Set the sample parameters.
 	BOOL locIsKeyFrame = (locInterFrameNo == 0);
 	locIsKeyFrame = TRUE;
@@ -609,6 +624,10 @@
 			//Set some other stuff here too...
 			mXOffset = ((sTheoraFormatBlock*)inMediaType->pbFormat)->xOffset;
 			mYOffset = ((sTheoraFormatBlock*)inMediaType->pbFormat)->yOffset;
+			//mHeight = ((sTheoraFormatBlock*)inMediaType->pbFormat)->frameHeight;
+			//mWidth = ((sTheoraFormatBlock*)inMediaType->pbFormat)->frameWidth;
+			debugLog<<"Setting height width to "<<mWidth<<" x "<<mHeight<<endl;
+			debugLog<<"Frame Dims were "<<((sTheoraFormatBlock*)inMediaType->pbFormat)->frameWidth<<" x "<<((sTheoraFormatBlock*)inMediaType->pbFormat)->frameHeight<<endl;
 
 		} else {
 			//Failed... should never be here !
@@ -618,12 +637,15 @@
 	} else {
 		debugLog<<"Setting Output Stuff"<<endl;
 		//Output pin SetMediaType
-		VIDEOINFOHEADER* locVideoHeader = (VIDEOINFOHEADER*)inMediaType->Format();
-		mHeight = (unsigned long)abs(locVideoHeader->bmiHeader.biHeight);
-		mWidth = (unsigned long)abs(locVideoHeader->bmiHeader.biWidth);
-		mFrameSize = (unsigned long)locVideoHeader->bmiHeader.biSizeImage;
+		//VIDEOINFOHEADER* locVideoHeader = (VIDEOINFOHEADER*)inMediaType->Format();
+		//mHeight = (unsigned long)abs(locVideoHeader->bmiHeader.biHeight);
+		//mWidth = (unsigned long)abs(locVideoHeader->bmiHeader.biWidth);
 
-		debugLog<<"Size = "<<mWidth<<" x "<<mHeight<<" ("<<mFrameSize<<")"<<endl;
+
+		//mFrameSize = (unsigned long)locVideoHeader->bmiHeader.biSizeImage;
+
+		//debugLog<<"Size = "<<mWidth<<" x "<<mHeight<<" ("<<mFrameSize<<")"<<endl;
+		//debugLog<<"Size in Format = "<<locVideoHeader->bmiHeader.biWidth<<" x "<<locVideoHeader->bmiHeader.biHeight<<endl;
 		return CTransformFilter::SetMediaType(PINDIR_OUTPUT, inMediaType);//CVideoTransformFilter::SetMediaType(PINDIR_OUTPUT, inMediaType);
 	}
 }



More information about the commits mailing list