From: Brett S. <bre...@gm...> - 2012-01-12 16:57:46
|
Hello, We are trying to learn how to interpret the picture that is returned by decodeNAL(..). We have the simple code below to try to print the picture to a .yuv file. I realize that I may need to add 32 to the width (though I'm not sure why, the dimensions are coming as 352x288 as expected...), and I realize that the /2 may be wrong for U and V if our assumption about format is wrong... But what is puzzling us is that it crashes on the loop writing the Y component when j==1389. If we comment out the Y loop, the U loop crashes at 1388. If anyone could give us a little insight into how to interpret the return from decodeNAL, it would really help us.. I know I should be able to see it from MPlayer... but the memory just gets set and passed around so much I'm not seeing how it gets used in the end... Thank you. int gotPicture = decodeNAL(_playerStruct, tbuff, i-start+1, &Picture, _Layer > ); > > if (gotPicture == SVC_IMAGE_READY) // 1 > { for (int j = 0; j < (Picture.Height)*(Picture.Width)-1; j++) > { > _dbg << "Y," << j << std::endl; > fputc((int) Picture.pY[j], _out); > } > for (int j = 0; j < ((Picture.Height * Picture.Width) -1 )/2; j++) > { > _dbg << "U," << j << std::endl; > fputc((int) Picture.pU[j], _out); > } > for (int j = 0; j < ((Picture.Height-1*Picture.Width) -1 )/2; j++) > { > _dbg << "V," << j << std::endl; > fputc((int) Picture.pV[j], _out); > } > > } t |