示例#1
0
        private void Execute(GpuContext gpu)
        {
            StructUnpacker unpacker = new StructUnpacker(gpu.MemoryAccessor, _configStructAddress + 0x20);

            SurfacePixelFormat pixelFormat = (SurfacePixelFormat)unpacker.Read(7);

            int chromaLocHoriz = unpacker.Read(2);
            int chromaLocVert  = unpacker.Read(2);

            int blockLinearKind       = unpacker.Read(4);
            int blockLinearHeightLog2 = unpacker.Read(4);

            int reserved0 = unpacker.Read(3);
            int reserved1 = unpacker.Read(10);

            int surfaceWidthMinus1  = unpacker.Read(14);
            int surfaceHeightMinus1 = unpacker.Read(14);

            int gobBlockHeight = 1 << blockLinearHeightLog2;

            int surfaceWidth  = surfaceWidthMinus1 + 1;
            int surfaceHeight = surfaceHeightMinus1 + 1;

            SurfaceOutputConfig outputConfig = new SurfaceOutputConfig(
                pixelFormat,
                surfaceWidth,
                surfaceHeight,
                gobBlockHeight,
                _outputSurfaceLumaAddress,
                _outputSurfaceChromaUAddress,
                _outputSurfaceChromaVAddress);

            _vdec.CopyPlanes(gpu, outputConfig);
        }