Commit Graph

21 Commits

Author SHA1 Message Date
twinaphex
fd52ca3d2d (Xbox 1 MSVC) Runs now on Xbox 1 2012-08-18 15:38:12 +02:00
sinamas
66c1af679e - Work around DWM compositor screwing up when duplicating frames by adding "DWM triple buffering" option (on by default) which sets presentparameters with frame queueing for all blitters.
- Work around DWM breaking windows with frame queuing after composition is disabled and re-enabled, by resetting present parameters on next video frame after composition enable event.
- Work around DWM breaking OpenGL window on minimize by unsetting present params on hide event, and setting on show event.
- Ignore sync to vblank when DWM composition is active.
- Deactivate sync to frame rate option when DWM composition is active.
- Make window size setting a menu rather than a part of video settings dialog.
- Work around Windows file dialog blocking events by waiting for pause to complete before launching such dialog.
- Work around events getting blocked when resizing on Windows by consuming pending blit requests on resizeEvent.
- WASAPI: Detect and use shared stream sampling rate in shared mode because all other rates appear to fail.
- Default screen names start at "1" rather than "0".
- Build fixes for mingw gcc 3.4.
- Refactoring.



git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@259 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-09-11 04:32:50 +00:00
sinamas
024370430c Add one level of unrolling to cic2.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@258 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-09-04 15:16:25 +00:00
sinamas
ce67eaa844 Allow intermediate polyphase sinc resamplers in a resampling chain to start/end (after fold) roll-off at limit of hearing if applicable, not just the final one.
Modify chain cost formulae and their derivatives for optimal ratios accordingly.


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@257 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-09-01 21:21:17 +00:00
sinamas
644441168c refactoring.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@256 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-08-25 17:35:27 +00:00
sinamas
962dc11503 refactoring.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@254 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-08-18 18:15:49 +00:00
sinamas
d21f4d5f91 - one more decimal position in refresh rate representation.
- use xrandr screen names
- hide empty full mode comboboxes
- windowed resolution -> window size
- lots of refactoring.


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@247 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-08-01 06:01:08 +00:00
sinamas
b517fae4b2 Fix 2xSAI video filter reading out of bounds.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@244 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-01-04 18:33:14 +00:00
sinamas
a42f267354 - Document libgambatte better.
- Document resampling framework better.
- Use a single constant for setting number of resampler channels rather 
than two.
- thread-safety -> thread safety


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@239 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2010-02-04 00:14:08 +00:00
sinamas
3eae18a18a - Move uncopyable.h to common.
- ScalingMethod header.
- length of video frame -> duration of video frame.


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@238 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2010-02-03 20:00:38 +00:00
sinamas
05a3d6935a - Move resample files around to separate interface files from
implementation files.


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@236 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2010-02-02 23:09:04 +00:00
sinamas
350533a224 - Redesign Qt multimedia framework to use a worker thread for MediaSource updates. This was a ton of work, but should make underruns a lot less likely. The majority of
underruns are caused by video I/O blocking (even when not syncing to vblank). It also means that vsync blocking is a non-issue. Lots of thread-safety considerations had to 
be done. Lots of tools developed to deal with new problems. Things redesigned to be asynchronous to avoid blocking the worker thread. New interfaces developed to give 
clients access to these things without too much pain, as clients need to deal with thread-safety issues, and be able to do things asynchronously to avoid blocking and 
unnecessary synchronization. Things developed and then scrapped as I changed my mind. Lots of thinking and testing to ensure video smoothness.
- Make configuration of the multimedia framework way more flexible, by adding methods for configuring video and sound, rather than forcing the use of the SoundDialog or 
VideoDialog. Thus clients can make their own GUI for such things.
- Pass raw input events to MediaSources so that clients will not have to use the InputDialog with its Button system.
- Split BlitterWidget blitting into three methods: blit, draw, and sync, such that blitting is supposedly a fast pixel copy or buffer swap, while draw prepares for 
presentation, and sync presents the completed video frame ASAP. Blit needs to be fast to avoid blocking the worker thread to avoid underruns.
- Allow heavy MediaSource video work to be skipped when frames are skipped.
- Do some work in parallel on SMP systems.
- Adjust low audio buffer detection to make it more robust.
- Move variance calculation to the user of estimations, because the variance calculated by estimators is not well defined anyway.
- Add support for adjustable fast-forward speed.
- Fast-forward now outputs audio, by skipping entire segments of audio when skipping frames.
- Adjust blitters to conform to the new threaded model.
- Direct3DBlitter: Apparently vertices point to the center of pixels. Subtract 0.5 from vertex coordinates.
- DirectDrawBlitter: Sleep more when far from vblank.
- QGLBlitter: Get rid of makeCurrent calls, because they apparently block and can be slow and don't seem to be needed anyway. They also seem to cause instability with some 
drivers.
- XvBlitter: Double buffer to delay updates to sync time.
- X11Blitter: Double buffer when not scaling to delay updates to sync time.
- QPainterBlitter: Double buffer when not scaling to delay updates to sync time.
- SdlBlitter: Delay updates to sync time.
- AlsaEngine: Set max periods to 16 to work around stupid ALSA plugins and drivers that advertise smaller period sizes than properly supported. ALSA always picks the 
maximum number of periods allowed, which means it picks the smallest period size allowed for a given buffer size.
- QPainterBlitter: Don't disable updates when not paused, because this breaks macx.
- Support pause on focus out.
- Add MiscDialog to allow user configuration of fast-forward speed and focus policy.
- Separate sync to refresh rate logic from sync to vblank logic.
- Sync to refresh rate menu option.
- Use semi-bilinear filtering rather than bilinear filtering for soft-scaling blitters.
- MakeSincKernel: Consider rounding effects when computing absolute gain.
- MakeSincKernel: Use a function pointer rather than a template argument to reduce code bloat.
- Reorder sinc kernel phases.
- PolyPhaseConvoluter: Simplify some calculations.
- Replace Hamming and Blackman windowed sincs with Kaiser windowed sinc of appropriate betas, because they require a lower number of taps to achieve the same specs.
- Use rounding shifts in resamplers for higher precision and performance.
- libgambatte: Update returns on video frame completion rather than using a callback for notification.
- libgambatte: Move video filters and color conversion out of the library.
- libgambatte: Get rid of unnecessarily complex VideoBlitter interface.
- libgambatte: Use bit flags rather bools for input state.
- Change some parameters to constants in 2xsai and hqx video filters.
- Probably other stuff I've forgotten about.



git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@234 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2010-02-02 21:30:46 +00:00
sinamas
3a66da4df8 - RateEst: Add a convenient way of filtering measures that extend beyond a buffer time, and are as such
probably invalid.
- RateEst: Allow using a custom timestamp in feed().
- RateEst: Keep a queue of the last ~100 msec worth of samples and duration, and filter out collective
  samples that give a pre-estimate that seems way off.


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@215 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2009-01-09 02:07:33 +00:00
sinamas
c69e48ac80 Substantially improved rate estimation averaging.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@204 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-12-25 23:45:53 +00:00
sinamas
5eb81ff36a Allow more rate estimation deviation.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@198 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-27 12:36:08 +00:00
sinamas
8a321f16c5 - Add CoreAudio engine with rate estimation and buffer status support. Default engine on Mac OS X.
- 44100 Hz default sample rate on OS X, since OS X tends to resample everything to 44100 Hz.
- Get rid of buffer status averaging in OpenAlEngine, since it makes assumptions on usage pattern that shouldn't be made.
- Extend ringbuffer.h to support resetting size, and move it to common dir since gambatte_qt/coreaudioengine uses it too now.


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@185 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-24 02:51:13 +00:00
sinamas
a5f83a3719 Fractional bits for intermediate rate estimation averages.
Add RateEst reset method. Initialize RateEst count to 1.
Less refresh rate estimation averaging.
Allow more refresh rate estimation deviation.
Return NULL paintEngine in windows blitters that use the PaintToScreen attribute.
Add checks for things not being initialized in DirectDraw-blitter and QPainterBlitter paintEvents.
Don't reparent blitters (mainly to make a bug in Qt 4.4.3 win less annoying, widgets that do internal reparenting are still affected).
Check for window position less than screen top-left after mode change, before full screen, to avoid Qt moving it to the primary screen.
Add rate estimation to DirectSound engine.
Better underrun detection in DirectSound engine.


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@182 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-19 20:24:27 +00:00
sinamas
8b64e527af Stricter estimate deviation limit
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@171 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-16 01:44:18 +00:00
sinamas
32232f58e1 More averaging in estimation code.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@170 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-15 02:04:15 +00:00
sinamas
f46b46d915 Do per phase normalization to avoid dc fluctuations.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@168 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-14 23:52:24 +00:00
sinamas
5bbabdcfdd - Real-time, sophisticated resampling framework with several performance/quality profiles for dynamically generated windowed sinc and CIC chains based on analysis of
fourier transforms and optimal cost equations. Fast 2-tap linear as a low quality alternative.
- libgambatte: Use deltas and a running sum to decrease buffer writes in sound emulation sample generation.
- libgambatte: Rearrange sound emulation event loop to optimize for high-frequency event units.
- libgambatte: Initialize palette arrays to avoid valgrind noise.
- Don't do resampling in libgambatte. Update API to reflect this.
- Move non-emulation common code to a common directory to avoid duplication.
- Update front-ends to new libgambatte API.
- Utilize resampling framework in front-ends. Selectable resamplers.
- Improved adaptive sleep class that estimates oversleep.
- Gambatte SDL: Estimate actual output sample rate in terms of OS timers and derive frame rate from it.
- Gambatte SDL: Move AudioData and RingBuffer classes to separate files.
- Gambatte SDL: Make underruns slightly less painful, by resetting buffer positions.
- Gambatte Qt: Update AudioEngine to support sample rate estimation in terms of OS timers.
- Gambatte Qt: Implement sample rate estimation in ALSA and OSS audio engines.
- Gambatte Qt: AlsaEngine: Revert to using snd_pcm_avail_update for buffer status since snd_pcm_delay may consider external latencies.
- Gambatte Qt: AlsaEngine: Use snd_pcm_hw_params_set_buffer_time_near. Don't request a particular number of periods per buffer.
- Gambatte Qt: AlsaEngine: Use hw as default custom device string, rather than hw:0,0.
- Gambatte Qt: OssEngine: Don't trust GETOSPACE fragment info.
- Gambatte Qt: Estimate optimal frame rate based on sample rate estimations.
- Gambatte Qt: Extend BlitterWidget to support estimation of vsynced frame rate in terms of OS timers.
- Gambatte Qt: Implement vsync frame rate estimation in QGlBlitter, Direct3DBlitter and DirectDrawBlitter.
- Gambatte Qt: Use a combination of OS timer sample rate estimation and vsync frame rate estimation to derive resampling ratio for no-frame-duplication vsync.
- Gambatte Qt: Change API to reflect MediaSources not being responsible for resampling.
- Gambatte Qt: Make sure to parent PaletteDialog list model, so it gets deleted properly.
- Various refactoring, small changes and stuff I forgot.


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@165 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-13 21:08:08 +00:00