Beispiel #1
0
 public PsxStreamDecoder(IMixer mixer, CDSpeed speed, PixelFormat screenFormat, uint frameCount = 0)
 {
     _mixer = mixer;
     _speed = speed;
     _screenFormat = screenFormat;
     _frameCount = frameCount;
 }
Beispiel #2
0
 public PsxStreamDecoder(IMixer mixer, CDSpeed speed, PixelFormat screenFormat, uint frameCount = 0)
 {
     _mixer        = mixer;
     _speed        = speed;
     _screenFormat = screenFormat;
     _frameCount   = frameCount;
 }
            public PsxVideoTrack(Stream firstSector, CDSpeed speed, uint frameCount, PixelFormat screenFormat)
            {
                var br = new BinaryReader(firstSector);
                _nextFrameStartTime = new Timestamp(0, (int)speed);
                _frameCount = frameCount;

                firstSector.Seek(40, SeekOrigin.Begin);
                _width = br.ReadUInt16();
                _height = br.ReadUInt16();
                _surface = new Surface(_width, _height, screenFormat, false);

                _macroBlocksW = (ushort)((_width + 15) / 16);
                _macroBlocksH = (ushort)((_height + 15) / 16);
                _yBuffer = new byte[_macroBlocksW * _macroBlocksH * 16 * 16];
                _cbBuffer = new byte[_macroBlocksW * _macroBlocksH * 8 * 8];
                _crBuffer = new byte[_macroBlocksW * _macroBlocksH * 8 * 8];

                _endOfTrack = false;
                _curFrame = -1;
                _acHuffman = new Huffman(0, AC_CODE_COUNT, s_huffmanACCodes, s_huffmanACLengths, s_huffmanACSymbols);
                _dcHuffmanChroma = new Huffman(0, DC_CODE_COUNT, s_huffmanDCChromaCodes, s_huffmanDCChromaLengths, s_huffmanDCSymbols);
                _dcHuffmanLuma = new Huffman(0, DC_CODE_COUNT, s_huffmanDCLumaCodes, s_huffmanDCLumaLengths, s_huffmanDCSymbols);
            }
Beispiel #4
0
            public PsxVideoTrack(Stream firstSector, CDSpeed speed, uint frameCount, PixelFormat screenFormat)
            {
                var br = new BinaryReader(firstSector);

                _nextFrameStartTime = new Timestamp(0, (int)speed);
                _frameCount         = frameCount;

                firstSector.Seek(40, SeekOrigin.Begin);
                _width   = br.ReadUInt16();
                _height  = br.ReadUInt16();
                _surface = new Surface(_width, _height, screenFormat, false);

                _macroBlocksW = (ushort)((_width + 15) / 16);
                _macroBlocksH = (ushort)((_height + 15) / 16);
                _yBuffer      = new byte[_macroBlocksW * _macroBlocksH * 16 * 16];
                _cbBuffer     = new byte[_macroBlocksW * _macroBlocksH * 8 * 8];
                _crBuffer     = new byte[_macroBlocksW * _macroBlocksH * 8 * 8];

                _endOfTrack      = false;
                _curFrame        = -1;
                _acHuffman       = new Huffman(0, AC_CODE_COUNT, s_huffmanACCodes, s_huffmanACLengths, s_huffmanACSymbols);
                _dcHuffmanChroma = new Huffman(0, DC_CODE_COUNT, s_huffmanDCChromaCodes, s_huffmanDCChromaLengths, s_huffmanDCSymbols);
                _dcHuffmanLuma   = new Huffman(0, DC_CODE_COUNT, s_huffmanDCLumaCodes, s_huffmanDCLumaLengths, s_huffmanDCSymbols);
            }