]> git.sesse.net Git - movit/log
movit
10 years agoAdd an effect to do re-slicing of the image, for overlap/discard.
Steinar H. Gunderson [Sun, 9 Mar 2014 20:55:39 +0000 (21:55 +0100)]
Add an effect to do re-slicing of the image, for overlap/discard.

This is another step on the way to making FFT convolutions useful.

10 years agoAdd utility functions for EffectChain to add inputs of different size from the output.
Steinar H. Gunderson [Sun, 9 Mar 2014 20:54:51 +0000 (21:54 +0100)]
Add utility functions for EffectChain to add inputs of different size from the output.

10 years agoDo our own fp16 conversion in ResampleEffect.
Steinar H. Gunderson [Sun, 9 Mar 2014 17:22:18 +0000 (18:22 +0100)]
Do our own fp16 conversion in ResampleEffect.

This not only fixes issues with poor downconversion on ATI, but also
allows us to normalize while being aware of fp16 roundoff issues.
Seems to about cut the error in half in the HeavyResampleGetsSumRight
test, which as far as I can see would take us up to 10-bit accuracy.

10 years agoStore all twiddle factors as fp16.
Steinar H. Gunderson [Sun, 9 Mar 2014 16:41:03 +0000 (17:41 +0100)]
Store all twiddle factors as fp16.

Seemingly this isn't such a big deal after all, especially now that
we have proper fp16 roundoff also on ATI.

10 years agoAdd a utility library for downconverting to fp16.
Steinar H. Gunderson [Sun, 9 Mar 2014 16:24:00 +0000 (17:24 +0100)]
Add a utility library for downconverting to fp16.

ATI's drivers don't do this properly by themselves, so we want to
do it on our side. Adapted from some code I wrote a few years ago.

10 years agoFix the widget display in the demo app.
Steinar H. Gunderson [Sun, 9 Mar 2014 11:36:00 +0000 (12:36 +0100)]
Fix the widget display in the demo app.

The demo app forgot to set a projection matrix, and when Movit itself
stopped setting one, the widget display broke.

10 years agoFix the roundoff test.
Steinar H. Gunderson [Sun, 9 Mar 2014 11:29:47 +0000 (12:29 +0100)]
Fix the roundoff test.

The wrong texture coordinates snuck in here when changing from fixed function.

10 years agoStop using 1D textures.
Steinar H. Gunderson [Sun, 9 Mar 2014 00:42:27 +0000 (01:42 +0100)]
Stop using 1D textures.

1D textures were never part of GLES, so use 2D textures with Nx1 instead.
Supposedly they are just as fast (although it feels a bit less elegant).

10 years agoRemove GL_LUMINANCE in more places.
Steinar H. Gunderson [Sat, 8 Mar 2014 23:41:38 +0000 (00:41 +0100)]
Remove GL_LUMINANCE in more places.

Causes problems with GL 3.2+ core contexts. Found by testing on ATI.

10 years agoUse the GL_RED texture format instead of GL_LUMINANCE.
Steinar H. Gunderson [Sat, 8 Mar 2014 21:13:59 +0000 (22:13 +0100)]
Use the GL_RED texture format instead of GL_LUMINANCE.

Seemingly GL_LUMINANCE is also deprecated; this actually decreases
support for GLES2 somewhat, but we need GLES3 anyway, so the net
loss shouldn't be too bad.

10 years agoUse triangle strips instead of quads.
Steinar H. Gunderson [Sat, 8 Mar 2014 20:44:43 +0000 (21:44 +0100)]
Use triangle strips instead of quads.

GL_QUADS is deprecated, seemingly, so rearrange things a bit so that
they become small triangle strips instead.

10 years agoUse VAOs to bind the VBOs.
Steinar H. Gunderson [Sat, 8 Mar 2014 20:35:29 +0000 (21:35 +0100)]
Use VAOs to bind the VBOs.

Needed for OpenGL 3.2+ core context support. Also refactor a bit,
since the amount of boilerplate was getting over the top.

10 years agoMake the initializing functions also drop fixed function usage.
Steinar H. Gunderson [Sat, 8 Mar 2014 17:37:25 +0000 (18:37 +0100)]
Make the initializing functions also drop fixed function usage.

10 years agoUse GLSL 1.30-style attributes for the main shader.
Steinar H. Gunderson [Sat, 8 Mar 2014 17:33:17 +0000 (18:33 +0100)]
Use GLSL 1.30-style attributes for the main shader.

This is in preparation for removing fixed-function use altogether,
for OpenGL 3.2+ core context support.

10 years agoCheck GLSL program link status, for better error reporting.
Steinar H. Gunderson [Sat, 8 Mar 2014 16:18:35 +0000 (17:18 +0100)]
Check GLSL program link status, for better error reporting.

10 years agoUse abort() on check_error() failure.
Steinar H. Gunderson [Sat, 8 Mar 2014 20:57:04 +0000 (21:57 +0100)]
Use abort() on check_error() failure.

This makes it much easier to trace them down in a debugger.

10 years agoFix a typo.
Steinar H. Gunderson [Wed, 12 Feb 2014 01:15:25 +0000 (02:15 +0100)]
Fix a typo.

10 years agoMove everything into “namespace movit”.
Steinar H. Gunderson [Wed, 12 Feb 2014 01:04:19 +0000 (02:04 +0100)]
Move everything into “namespace movit”.

This is a pretty hard API break, but it's probably the last big API
break before 1.0, and some of the names (e.g. Effect, Input ResourcePool)
are really so generic that they should not be allowed to pollute the global
namespace.

10 years agoMake init_movit() return a true/false error value.
Steinar H. Gunderson [Wed, 12 Feb 2014 00:44:42 +0000 (01:44 +0100)]
Make init_movit() return a true/false error value.

This allows clients to programmatically enable/disable Movit usage
as needed on very old platforms.

10 years agoMake a pow() call unambiguous.
Steinar H. Gunderson [Mon, 27 Jan 2014 22:04:44 +0000 (23:04 +0100)]
Make a pow() call unambiguous.

10 years agoRemove the finalize() member function from Input.
Steinar H. Gunderson [Sun, 26 Jan 2014 23:44:44 +0000 (00:44 +0100)]
Remove the finalize() member function from Input.

It is no longer needed now that the texture is not created once,
but rather fetched on-demand from the ResourcePool.

10 years agoSend shader compile log to stderr instead of stdout.
Steinar H. Gunderson [Sun, 26 Jan 2014 23:04:36 +0000 (00:04 +0100)]
Send shader compile log to stderr instead of stdout.

Reported by Dan Dennedy.

10 years agoExplicitly declare use of round() as an #extension.
Steinar H. Gunderson [Sun, 26 Jan 2014 23:03:36 +0000 (00:03 +0100)]
Explicitly declare use of round() as an #extension.

round() is not part of GLSL 1.10, so we need to check explicitly for it
before we can use it.

Reported by Dan Dennedy.

10 years agoIn EffectChainTest, do not re-call init_movit()
Steinar H. Gunderson [Sun, 26 Jan 2014 01:44:17 +0000 (02:44 +0100)]
In EffectChainTest, do not re-call init_movit()

Seemingly this causes problems on ATI, for unknown reasons.
In any case, just flipping the debug level is much easier.

10 years agoMake the ResampleEffect accuracy test stricter.
Steinar H. Gunderson [Sat, 25 Jan 2014 18:43:29 +0000 (19:43 +0100)]
Make the ResampleEffect accuracy test stricter.

First, make sure we test one individual pass, and that we test it in
fp32. Second, set a limit that's actually grounded in something real,
not just a pretty power of 10.

10 years agoNormalize the resample weight after bilinear combining.
Steinar H. Gunderson [Sat, 25 Jan 2014 18:41:40 +0000 (19:41 +0100)]
Normalize the resample weight after bilinear combining.

We introduce a small bit of error in the combining (due to having to
compensate for lack of subpixel sampling precision), so normalize
after it rather than before it. Also, do a second normalization pass,
which seemingly helps sometimes (probably due to inaccuracies in the
float sum).

This seems to kill about half the precision loss on Intel, at least.

10 years agoDon't dither alpha.
Steinar H. Gunderson [Sat, 25 Jan 2014 12:57:41 +0000 (13:57 +0100)]
Don't dither alpha.

For alpha, correct rounding is more important to us than overall
spectral properties, simply because 255 -> 255 is such an important
case.

10 years agoRescale resampling weights so that the sum becomes one.
Steinar H. Gunderson [Sat, 25 Jan 2014 11:42:56 +0000 (12:42 +0100)]
Rescale resampling weights so that the sum becomes one.

For some reason, I had forgotten this, and it showed up because Qt
has buggy handling of pixels with alpha != 0xff. Add unit test
so it doesn't happen again.

I'm a bit concerned that rounding might cause problems so that we
should perhaps renormalize after the bilinear conversion, but we
can deal with that later if it should show up.

10 years agoRemove sandbox_effect from coverage.
Steinar H. Gunderson [Thu, 23 Jan 2014 01:20:23 +0000 (02:20 +0100)]
Remove sandbox_effect from coverage.

10 years agoAnother round of include-what-you-use.
Steinar H. Gunderson [Thu, 23 Jan 2014 01:13:27 +0000 (02:13 +0100)]
Another round of include-what-you-use.

10 years agoSet an explicit C++ tag on libtool, to ease compiling with Clang.
Steinar H. Gunderson [Thu, 23 Jan 2014 01:00:44 +0000 (02:00 +0100)]
Set an explicit C++ tag on libtool, to ease compiling with Clang.

10 years agoAdd SHELL override from autoconf, since otherwise libtool might break on systems...
Steinar H. Gunderson [Thu, 23 Jan 2014 00:50:33 +0000 (01:50 +0100)]
Add SHELL override from autoconf, since otherwise libtool might break on systems with dash.

10 years agoMove to 'using namespace std;' in all .cpp files.
Steinar H. Gunderson [Thu, 23 Jan 2014 00:35:34 +0000 (01:35 +0100)]
Move to 'using namespace std;' in all .cpp files.

There's no intrinsic value to writing std:: over and over again.
We keep it in the .h file, of course, in order not to pollute
clients' namespaces.

10 years agoTweak the exclusion rules for coverage computation a bit.
Steinar H. Gunderson [Thu, 23 Jan 2014 00:03:30 +0000 (01:03 +0100)]
Tweak the exclusion rules for coverage computation a bit.

10 years agoAdd a unit test for VignetteEffect, and fix two bugs.
Steinar H. Gunderson [Wed, 22 Jan 2014 23:43:58 +0000 (00:43 +0100)]
Add a unit test for VignetteEffect, and fix two bugs.

As usual, adding unit tests uncovers bugs (although one was known
in this case):

 - Make VignetteEffect work with any aspect, not only 16:9 (known).
 - Make sure (0,0) is upper-left for center, not lower-left as in
   OpenGL.

10 years agoAdd a unit test for EffectChain without shared ResourcePool.
Steinar H. Gunderson [Wed, 22 Jan 2014 21:48:40 +0000 (22:48 +0100)]
Add a unit test for EffectChain without shared ResourcePool.

Also tests debug output; just that it doesn't crash, but that's nice
in itself. This code was seeing a bit scary low coverage after some
test changes.

10 years agoUnbreak demo build (it was broken due to a typo).
Steinar H. Gunderson [Wed, 22 Jan 2014 20:04:44 +0000 (21:04 +0100)]
Unbreak demo build (it was broken due to a typo).

10 years agoSome tweaks to the libtool parts of the Makefile.
Steinar H. Gunderson [Wed, 22 Jan 2014 09:39:47 +0000 (10:39 +0100)]
Some tweaks to the libtool parts of the Makefile.

We don't need to build all the non-lib files (especially the unit tests)
using libtool, so save some CPU time there. Also, unbreak coverage builds.

10 years agoUse the libtool autoconf macros.
Steinar H. Gunderson [Wed, 22 Jan 2014 00:59:10 +0000 (01:59 +0100)]
Use the libtool autoconf macros.

10 years agoUse libtool for building libraries and binaries.
Steinar H. Gunderson [Wed, 22 Jan 2014 00:16:18 +0000 (01:16 +0100)]
Use libtool for building libraries and binaries.

This means we get a shared library built, which should make building
in MLT a lot easier.

Note that Movit still does not export a stable ABI! This is reflected
in that the version number is still 0.0.0 and does not change between
checkins.

10 years agoFix mis-feeing in the ResourcePool destructor.
Steinar H. Gunderson [Tue, 21 Jan 2014 22:58:11 +0000 (23:58 +0100)]
Fix mis-feeing in the ResourcePool destructor.

10 years agoMake FlatInput and YCbCrInput release the texture to the pool on invalidate_pixel_data().
Steinar H. Gunderson [Tue, 21 Jan 2014 22:09:59 +0000 (23:09 +0100)]
Make FlatInput and YCbCrInput release the texture to the pool on invalidate_pixel_data().

10 years agoUse the ResourcePool to allocate RTT textures in EffectChain.
Steinar H. Gunderson [Tue, 21 Jan 2014 22:02:22 +0000 (23:02 +0100)]
Use the ResourcePool to allocate RTT textures in EffectChain.

10 years agoImplement the texture freelist in ResourcePool.
Steinar H. Gunderson [Tue, 21 Jan 2014 21:26:12 +0000 (22:26 +0100)]
Implement the texture freelist in ResourcePool.

10 years agoAdd missing format LUMINANCE8.
Steinar H. Gunderson [Tue, 21 Jan 2014 20:41:57 +0000 (21:41 +0100)]
Add missing format LUMINANCE8.

10 years agoFix YCbCrInput after the ResourcePool texture changes.
Steinar H. Gunderson [Tue, 21 Jan 2014 20:39:09 +0000 (21:39 +0100)]
Fix YCbCrInput after the ResourcePool texture changes.

10 years agoComplete a forgotten comment.
Steinar H. Gunderson [Tue, 21 Jan 2014 20:01:25 +0000 (21:01 +0100)]
Complete a forgotten comment.

10 years agoAdd support to the ResourcePool for 2D textures.
Steinar H. Gunderson [Tue, 21 Jan 2014 19:42:34 +0000 (20:42 +0100)]
Add support to the ResourcePool for 2D textures.

Currently we don't have a freelist, but this will change shortly.

10 years agoRetire the GL_GENERATE_MIPMAP hack for FlatInput.
Steinar H. Gunderson [Mon, 20 Jan 2014 23:56:27 +0000 (00:56 +0100)]
Retire the GL_GENERATE_MIPMAP hack for FlatInput.

I found very similar workaround code for this bug in Chromium,
with the following comment:

  // Workaround for Mac driver bug. In the large scheme of things setting
  // glTexParamter twice for glGenerateMipmap is probably not a lage performance
  // hit so there's probably no need to make this conditional. The bug appears
  // to be that if the filtering mode is set to something that doesn't require
  // mipmaps for rendering, or is never set to something other than the default,
  // then glGenerateMipmap misbehaves.

Going back all the way to the point in which this code was written,
it is indeed true; we called glGenerateMipmap(), and then right afterwards
set the mode to GL_LINEAR_MIPMAP_NEAREST. Since then, the code has been
reorganized and moved around a lot, and now we set the mode long before
the first call to glGenerateMipmap(), and thus we can retire the hack;
simply generate mipmaps on-demand, and that's the end of it. I tested
with the Mesa 8.0.x version where I originally saw this bug, and it passes
flat_input_test without any problems (well, actually all tests except
the tests for deconvolution sharpen, whose shaders are too big for it).

This is nice not only because it gives us a less hacky structure, but also
because GL_GENERATE_MIPMAPS is a nightmare for the driver to handle;
several edge conditions are tricky, from what I've been told.

10 years agoDisable OpenGL dithering, just to be on the safe side.
Steinar H. Gunderson [Sun, 19 Jan 2014 22:54:49 +0000 (23:54 +0100)]
Disable OpenGL dithering, just to be on the safe side.

I don't actually think any modern OpenGL implementations actually
heed this flag for 8-bit rendering, but it's fine to be on the safe
side nevertheless.

10 years agoRound explicitly after dithering, for GPUs that don't do it properly themselves.
Steinar H. Gunderson [Sun, 19 Jan 2014 22:53:18 +0000 (23:53 +0100)]
Round explicitly after dithering, for GPUs that don't do it properly themselves.

This was causing unit test failures in the DitherEffect unit test both on
ATI and nVidia GPUs; Intel also rounds somewhat inaccurately, but much,
much better, so the extra code won't be activated for them.

I think this might be driver-dependent, but we will detect it correctly
in any case.

10 years agoStore GL_FLOAT FlatInputs as fp32, not fp16.
Steinar H. Gunderson [Sun, 19 Jan 2014 19:42:22 +0000 (20:42 +0100)]
Store GL_FLOAT FlatInputs as fp32, not fp16.

There are two primary reasons for this:

 - GL_FLOAT FlatInput is primarily used for tests, and even more importantly,
   mostly accuracy tests. ATI's drivers appear to round off fp32 -> fp16
   wrong (truncate instead of round), which breaks some of these tests.
 - In case someone _would_ use GL_FLOAT inputs, they'd probably be updated
   every frame anyway, so the fp32 -> fp16 conversion step (probably on CPU)
   will negate any performance benefits by fp16 sampling anyway.

10 years agoTurn off .dot and .frag file generation during unit tests.
Steinar H. Gunderson [Sun, 19 Jan 2014 17:41:21 +0000 (18:41 +0100)]
Turn off .dot and .frag file generation during unit tests.

Even though this is sometimes useful in the effect_chain_test,
this makes the test suite literally five times as fast on my
machine due to all the disk I/O. We can always turn it on again
when debugging specific issues.

10 years agoAdd a new effect that can do FFT/IFFT.
Steinar H. Gunderson [Sun, 19 Jan 2014 17:27:55 +0000 (18:27 +0100)]
Add a new effect that can do FFT/IFFT.

10 years agoWe need to link the main library against pthreads now, since we lock in ResourcePool.
Steinar H. Gunderson [Sun, 19 Jan 2014 16:46:26 +0000 (17:46 +0100)]
We need to link the main library against pthreads now, since we lock in ResourcePool.

10 years agoMake effect_id phase-local instead of global.
Steinar H. Gunderson [Sat, 18 Jan 2014 21:07:29 +0000 (22:07 +0100)]
Make effect_id phase-local instead of global.

This is mainly to reduce the number of substantially identical shaders
we have to keep around and compile; even though two chains may be
different, often, some phase (and very often, a large one at that)
will be similar. However, in the old system, since effects had global
IDs, a change in an earlier phase would displace identifiers in a
later one, and the shader would be uncacheable.

Note that this means that an effect can actually have multiple effect_ids
now (since it could already be part of multiple phases). This is the
reason why we can't just keep having a single effect_id on the node
that we set phase-locally; it really needs to be different between phases.

10 years agoAdd a shared ResourcePool to share resources between EffectChains.
Steinar H. Gunderson [Fri, 17 Jan 2014 21:25:12 +0000 (22:25 +0100)]
Add a shared ResourcePool to share resources between EffectChains.

Right now in this first implementation, we only share shaders,
which mainly saves compile time when multiple EffectChains are
similar (e.g., many clips all are modified by white balance only).
However, in the future, the plan is for them to also be able to
share temporary textures.

10 years agoDocument EffectChain threading considerations.
Steinar H. Gunderson [Fri, 17 Jan 2014 18:01:21 +0000 (19:01 +0100)]
Document EffectChain threading considerations.

10 years agoAdd a file-level comment for EffectChain.
Steinar H. Gunderson [Fri, 17 Jan 2014 17:57:13 +0000 (18:57 +0100)]
Add a file-level comment for EffectChain.

10 years agoRemove the support for 1D textures as parameters.
Steinar H. Gunderson [Tue, 14 Jan 2014 21:48:42 +0000 (22:48 +0100)]
Remove the support for 1D textures as parameters.

This isn't required anymore after the Gamma{Compression,Expansion}Effect
stopped using it; and after seeing how it was easy to missample them
with regards to texture coordinates, I'm not honestly so sure anymore
they were a good idea in the first place.

10 years agoRemove unused element need_texture_update from DitherEffect.
Steinar H. Gunderson [Tue, 14 Jan 2014 19:10:50 +0000 (20:10 +0100)]
Remove unused element need_texture_update from DitherEffect.

Found by Coverity Scan.

10 years agoLet the application manage PBOs.
Steinar H. Gunderson [Sat, 11 Jan 2014 23:48:41 +0000 (00:48 +0100)]
Let the application manage PBOs.

Creating a PBO to hold the texture data just before upload (like we
did before this patch) is pointless; if that would help at all, the driver
could just do it itself. Instead, we expose the PBOs to the application
(in a way such that applications that don't care can continue to use
the simple interface). This means that a client that needs to do
e.g. a fade can optimize its texture upload by a process like this:

  1. Decode frame from input A.
  2. Upload frame from input A to GPU (by putting it into a PBO).
     Texture upload starts in the background.
  3. Decode frame from input B.
  4. Upload frame from input B to GPU. (This time, there will be
     no parallelism, though.)
  5. Render.

With correct use of ping-ponging PBOs, it is also possible to overlap
step 4/5 with operations from the _next_ frame in the fade.

More information can be found in this presentation:

  http://on-demand.gputechconf.com/gtc/2012/presentations/S0356-GTC2012-Texture-Transfers.pdf

10 years agoImplement GammaCompressionEffect using ALU ops instead of texture lookups.
Steinar H. Gunderson [Thu, 9 Jan 2014 23:51:52 +0000 (00:51 +0100)]
Implement GammaCompressionEffect using ALU ops instead of texture lookups.

This is the same as GammaExpansionEffect; however, the numerical issues
are much much bigger, and it took forever to actually get the coefficients
right for proper accuracy.

Added accuracy tests to GammaCompressionEffect to make sure things are
fine; unsurprisingly, just as with GammaExpansionEffect, the old texture
code wasn't all that accurate. The effects were not as bad, though;
it primarily affects 10- and 12-bit processing, and Movit isn't ready
for 12-bit accuracy-wise.

The benchmark wins are huge; in a chain with effectively only a
GammaExpansionEffect and a GammaCompressionEffect, FPS on Sandy Bridge
(HD3000) goes up ~80%. Seemingly sampling that 4096x1 texture was really
expensive.

10 years agoComment and README updates about Rec. 2020 in light of the accuracy test results.
Steinar H. Gunderson [Thu, 9 Jan 2014 20:50:43 +0000 (21:50 +0100)]
Comment and README updates about Rec. 2020 in light of the accuracy test results.

10 years agoAdd accuracy unit tests for GammaExpansionEffect.
Steinar H. Gunderson [Thu, 9 Jan 2014 19:55:02 +0000 (20:55 +0100)]
Add accuracy unit tests for GammaExpansionEffect.

After all the worry about accuracy in the polynomial expansion,
I figured it was time to actually add tests verifying the error
bounds here in a more reasonable way. The limits are set sort-of
randomly, more-or-less to what the new code already handles,
rounded up a bit. (The old texture-based code was _way_ worse than this,
it seems, probably due to texel center issues.)

This also shows that you can probably do 10-bit processing with
Movit without losing way too much accuracy, but that 12-bit is
too much for fp16 to handle.

10 years agoFix edge errors in the sRGB comment; I had used subs() on the wrong expression.
Steinar H. Gunderson [Wed, 8 Jan 2014 21:30:22 +0000 (22:30 +0100)]
Fix edge errors in the sRGB comment; I had used subs() on the wrong expression.

10 years agoFix a typo in a comment.
Steinar H. Gunderson [Wed, 8 Jan 2014 21:28:09 +0000 (22:28 +0100)]
Fix a typo in a comment.

10 years agoImplement GammaExpansionEffect using ALU ops instead of texture lookups.
Steinar H. Gunderson [Wed, 8 Jan 2014 21:14:42 +0000 (22:14 +0100)]
Implement GammaExpansionEffect using ALU ops instead of texture lookups.

In a standalone benchmark (on a Sandy Bridge laptop), this is pretty much
a no-op performance-wise, but when more ops are put into the mix, it's
a ~20% FPS win, and but in a more real situation with multiple inputs
etc., it's subjectively also a pretty clear win. The reason is probably
that we generally are way overloaded on texture operations.

Note that we had similar code like this before (before we started using
the texture for lookup), but it used pow(), which is markedly slower than our
fourth-degree polynomial approximation.

We should probably do the same for GammaCompressionEffect.

10 years agoIn the demo application, reset the FPS counter every hundred frames.
Steinar H. Gunderson [Wed, 8 Jan 2014 20:28:08 +0000 (21:28 +0100)]
In the demo application, reset the FPS counter every hundred frames.

Gives much, much better FPS counts for benchmarking.

10 years agoFix some outdated comments in GammaExpansionEffect.
Steinar H. Gunderson [Wed, 8 Jan 2014 20:22:35 +0000 (21:22 +0100)]
Fix some outdated comments in GammaExpansionEffect.

10 years agoIt's now 2014 :-P (Happy new year!)
Steinar H. Gunderson [Fri, 3 Jan 2014 01:22:55 +0000 (02:22 +0100)]
It's now 2014 :-P (Happy new year!)

10 years agoAdd an assertion failure that we don't add the same effect instance twice.
Steinar H. Gunderson [Wed, 1 Jan 2014 23:25:24 +0000 (00:25 +0100)]
Add an assertion failure that we don't add the same effect instance twice.

Doing this causes hard-to-understand crashes, so just bomb out at once.

10 years agoCalculate the RGB-to-XYZ matrix ourselves instead of using a “magic” one from Wikipedia.
Steinar H. Gunderson [Wed, 1 Jan 2014 11:43:36 +0000 (12:43 +0100)]
Calculate the RGB-to-XYZ matrix ourselves instead of using a “magic” one from Wikipedia.

Generally we try to derive such values from first principles when possible;
this is some of the oldest code in Movit, which explains why it was forgotten.

Maybe longer-term we should move this out of ColorspaceConversionEffect into a
free function in util.h or something similar, but for now, this will do.

10 years agoFix a minor error in one of the color temperature constants.
Steinar H. Gunderson [Mon, 30 Dec 2013 01:33:50 +0000 (02:33 +0100)]
Fix a minor error in one of the color temperature constants.

Wikipedia cites http://icpr.snu.ac.kr/resource/wop.pdf/J01/2002/041/R06/J012002041R060865.pdf,
but seems to differ in in the last decimal of one of the coefficients.
The error is, of course, inconsequential, but it's good to be correct
in any case, and I trust the paper more.

10 years agoAdd partial Rec. 2020 support.
Steinar H. Gunderson [Mon, 30 Dec 2013 01:31:23 +0000 (02:31 +0100)]
Add partial Rec. 2020 support.

10 years agoGenerate the FBO anew every render.
Steinar H. Gunderson [Sun, 29 Dec 2013 22:59:05 +0000 (23:59 +0100)]
Generate the FBO anew every render.

This fixes an issue where reusing the same EffectChain from two different GL
contexts would cause errors even if they are shared, because FBOs cannot be
shared between contexts (in the ARB extension, anyway).

There might be some negative performance implications to this, but I was unable
to measure any on Intel/Mesa. If this should prove to be a problem in the future,
we could maybe keep one around per context, or have the caller invalidate the
FBO for us.

10 years agoFix a bug where DeconvolutionSharpenEffect would forget one line of the kernel.
Steinar H. Gunderson [Sun, 29 Dec 2013 22:55:57 +0000 (23:55 +0100)]
Fix a bug where DeconvolutionSharpenEffect would forget one line of the kernel.

This manifested itself in that non-identity filters would start changing alpha
of solid images (since the kernel didn't sum up to one), which obviously isn't
good. Added a unit test to make sure it doesn't happen again.

10 years agoInstall effect_util.h; it is useful for people implementing their own effects.
Steinar H. Gunderson [Tue, 24 Dec 2013 15:07:56 +0000 (16:07 +0100)]
Install effect_util.h; it is useful for people implementing their own effects.

10 years agoSpelling fix.
Steinar H. Gunderson [Tue, 24 Dec 2013 12:51:34 +0000 (13:51 +0100)]
Spelling fix.

10 years agoAssert that the EffectChain is not finalized when someone tries to modify it.
Steinar H. Gunderson [Tue, 24 Dec 2013 00:51:42 +0000 (01:51 +0100)]
Assert that the EffectChain is not finalized when someone tries to modify it.

10 years agoFix another harmless Valgrind hit.
Steinar H. Gunderson [Sun, 22 Dec 2013 22:58:28 +0000 (23:58 +0100)]
Fix another harmless Valgrind hit.

10 years agoProperly check framebuffer status when generating FBOs.
Steinar H. Gunderson [Sun, 22 Dec 2013 22:47:02 +0000 (23:47 +0100)]
Properly check framebuffer status when generating FBOs.

10 years agoFix an issue with invalid texture number usage in measure_texel_subpixel_precision().
Steinar H. Gunderson [Sun, 22 Dec 2013 22:46:51 +0000 (23:46 +0100)]
Fix an issue with invalid texture number usage in measure_texel_subpixel_precision().

10 years agoA small comment fix in ColorspaceConversionEffect.
Steinar H. Gunderson [Mon, 16 Dec 2013 20:25:07 +0000 (21:25 +0100)]
A small comment fix in ColorspaceConversionEffect.

10 years agoProperly link in multiply_effect.
Steinar H. Gunderson [Sat, 14 Dec 2013 01:20:25 +0000 (02:20 +0100)]
Properly link in multiply_effect.

10 years agoPromote MultiplyEffect to a real effect.
Steinar H. Gunderson [Wed, 6 Nov 2013 23:20:59 +0000 (00:20 +0100)]
Promote MultiplyEffect to a real effect.

The intended use is for overlays, where you'd want to do e.g.
0.2*x atop y instead of just x atop y, fading the overlay in or out.

Also, give it full RGBA inputs, as that might potentially be useful
for someone. It certainly was useful for adapting it to continue to
be used in the EffectChain unit test, at least. (It doesn't have
its own unit test, since it's so trivial.)

10 years agoFix a bug where PaddingEffect could create assertion errors.
Steinar H. Gunderson [Wed, 9 Oct 2013 20:24:56 +0000 (22:24 +0200)]
Fix a bug where PaddingEffect could create assertion errors.

The ratinale is explained in the comment, but in short, PaddingEffect
could convert blank to premultiplied alpha without realizing that
it then needed linear light (since premultiplied alpha in our case
is defined as being in linear light). Also added a unit test.

Reported by Christophe Thommeret.

10 years agoClip below-zero (out-of-gamut) colors in LiftGammaGainEffect.
Steinar H. Gunderson [Sat, 28 Sep 2013 22:16:48 +0000 (00:16 +0200)]
Clip below-zero (out-of-gamut) colors in LiftGammaGainEffect.

pow(x, y) for x < 0 is undefined, and behaves differently on nVidia
and Intel. This can reasonably happen when having inputs from a different
gamut, or just a complex chain before the LGG effect; there's nothing
in Movit that prohibits out-of-sRGB-gamut colors. Thus, we need to detect
such inputs and clamp them.

We could in theory check for the special case of y=1 (no gamma change)
and allow negative values through then, but this wouldn't seem like a good
solution, especially if animating gamma.

Found and debugged by Christophe Thommeret.

11 years agoMake building the demo app optional if SDL_image and/or libpng12 are not found.
Steinar H. Gunderson [Wed, 6 Feb 2013 00:09:27 +0000 (01:09 +0100)]
Make building the demo app optional if SDL_image and/or libpng12 are not found.

11 years agoAdd a pkg-config variable “shaderdir” to locate the shaders.
Steinar H. Gunderson [Tue, 5 Feb 2013 09:26:49 +0000 (10:26 +0100)]
Add a pkg-config variable “shaderdir” to locate the shaders.

Patch from Dan Dennedy.

11 years agoInstall defs.h on make install, since it is needed by effect.h.
Steinar H. Gunderson [Tue, 5 Feb 2013 09:15:02 +0000 (10:15 +0100)]
Install defs.h on make install, since it is needed by effect.h.

11 years agoPut the resample alpha handling on the right effect.
Steinar H. Gunderson [Sun, 3 Feb 2013 15:39:44 +0000 (16:39 +0100)]
Put the resample alpha handling on the right effect.

11 years agoIndentation fix in Makefile.in.
Steinar H. Gunderson [Sun, 3 Feb 2013 15:09:27 +0000 (16:09 +0100)]
Indentation fix in Makefile.in.

11 years agoDo not call autoheader, since we do not use config.h.
Steinar H. Gunderson [Sun, 3 Feb 2013 15:06:50 +0000 (16:06 +0100)]
Do not call autoheader, since we do not use config.h.

11 years agoUse autoconf defaults for CXX and CXXFLAGS.
Steinar H. Gunderson [Sun, 3 Feb 2013 15:06:35 +0000 (16:06 +0100)]
Use autoconf defaults for CXX and CXXFLAGS.

11 years agoRename RGBATriplet to RGBATuple, to avoid silliness.
Steinar H. Gunderson [Sun, 3 Feb 2013 15:04:12 +0000 (16:04 +0100)]
Rename RGBATriplet to RGBATuple, to avoid silliness.

11 years agoMake util.h private to the effects; instead, defs.h contains what effect.h needs...
Steinar H. Gunderson [Sun, 3 Feb 2013 14:17:39 +0000 (15:17 +0100)]
Make util.h private to the effects; instead, defs.h contains what effect.h needs. Keeps some junk out of the namespace of the client.

11 years agoPrefix include guards with _MOVIT to avoid clashes with external files.
Steinar H. Gunderson [Sun, 3 Feb 2013 14:14:11 +0000 (15:14 +0100)]
Prefix include guards with _MOVIT to avoid clashes with external files.

11 years agoSmall cleanup in movit.pc.in.
Steinar H. Gunderson [Sun, 3 Feb 2013 12:52:53 +0000 (13:52 +0100)]
Small cleanup in movit.pc.in.

11 years agoAdd a distclean target.
Steinar H. Gunderson [Sun, 3 Feb 2013 12:39:43 +0000 (13:39 +0100)]
Add a distclean target.