basically, I am sitting around mostly lazily just writing plain C code, largely without resorting to anything "fancy" here in an attempt to get performance (ex: ASM, SIMD, multithreading, ...), though admittedly there was some amount of micro-optimizing and "fine tuning", ... (a lot of this is used elsewhere in the project, just not in the code in question...).
ok, so?...
I "recently" went and wrote a version of my currently-active video codec mostly for real-time capture, and with some fiddling got it up to doing around 1680x1050 at 30fps (with the recording front-end being VirtualDub). basically does full desktop capture at typically around 12% CPU load on my system (though if the CPU load for VirtualDub hits 15% it will drop below 30 and start dropping frames, with a single-threaded encoder).
what is a mystery is, ok, I have done this, but why then are there so few other options that can do similarly or better?...
one program will encode using MS-CRAM (MS Video 1), which goes fast enough but the video quality leaves much to be desired.
FRAPS sort of holds up ok (despite the free version having a recording time-limit and similar), but grinds the HDD pretty bad and goes through unreasonably large amounts of HDD space.
another program based around x264 basically runs the CPU at full load (on all cores), lags computer some, and has to use downsampling to be able to record in real-time (on settings for high-speed encoding).
well, ok, there is Lagarith, using Lagarith via VirtualDub pulling around 27 fps and running the CPU at 30%-40% load, with VirtualDub still dropping frames (still a viable option though).
also tested capturing using XviD, but it didn't hold up well (quickly dropped below 20 fps, while pretty much maxing-out the CPU in the process).
well, nevermind differences between the various formats, which can contribute a fair bit to the computational cost of encoding.
well, and me also throwing together a BC7 encoder (now with partition support) generally fast enough for load-time encoding (still probably a bit too slow for real-time though).
then again, I don't use a brute-force search, instead driving most of the process by arithmetic and lookup tables.
ex:
RGB -> YCbCr, then do VQ magic on the CbCr values, and use this to drive a lookup table (to get the partition, a series of LUTs are built when the coder initializes which map chroma-space vectors to partition numbers);
the partition is then used by the good old CYGM endpoint-selector (*), which chooses endpoints independently per-partition;
the various options (block-format / etc) are then evaluated and then the final output block is produced.
the logic could still be faster (ex: as-is, it has to run the filter / endpoint classifier multiple times per block, ... and seems to be the bottleneck here).
*: CYGM=Cyan, Yellow, Green, Magenta. basically the pixels are converted into a CYGM-based color-space, and this is used to evaluate the endpoints (in prior tests for naive linear classifier axes, CYGM seemed to give the best results). this was also computationally cheaper than some other options, while giving generally better results than simply classifying things based on Luma.
( the CYGM filter was previously used some with video recording, but framerates didn't hold at higher resolutions, so recording has reverted to a luma-driven selector, with a potentially cheaper algorithm considered as a possible option to improve image quality. still used for batch encoding and for load-time texture conversion and similar, as these are less speed-critical...).
I don't really get it, it didn't really seem all that difficult to get ok speeds out of BC7 encoding, but a lot of the existing encoders seem to take a very long time and need to resort to GPGPU stuff and similar...
unless it is mostly time spent on looking more for an "optimal" solution, rather than finding a "good approximate" to be sufficient?... does still seem a little steep though.
well, also BC7 is used as the current primary texture format for sending video to the GPU (replacing DXT5, mostly as BC7 can give better image quality).
sorry if there is no particular question here, but, thoughts?...