movit
6 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.

6 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.

6 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.

6 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

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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!)

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

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

6 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.

6 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.

6 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.

6 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().

6 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.

6 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.

6 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.)

6 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.

6 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.

7 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.

7 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.

7 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.

7 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.

7 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.

7 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.

7 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.

7 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.

7 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.

7 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.

7 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.

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

7 years agoUpdate README for the new output alpha constants.
Steinar H. Gunderson [Sun, 3 Feb 2013 12:39:34 +0000 (13:39 +0100)]
Update README for the new output alpha constants.

7 years agoFix cleaning of .dot and .frag files.
Steinar H. Gunderson [Sun, 3 Feb 2013 12:37:44 +0000 (13:37 +0100)]
Fix cleaning of .dot and .frag files.

7 years agoAdd a pkg-config file.
Steinar H. Gunderson [Sun, 3 Feb 2013 12:35:18 +0000 (13:35 +0100)]
Add a pkg-config file.

7 years agoMakefile should now be in .gitignore.
Steinar H. Gunderson [Sun, 3 Feb 2013 12:34:21 +0000 (13:34 +0100)]
Makefile should now be in .gitignore.

7 years agoRemove stray file movit_pch.h, which was never meant to be checked in.
Steinar H. Gunderson [Sun, 3 Feb 2013 12:27:05 +0000 (13:27 +0100)]
Remove stray file movit_pch.h, which was never meant to be checked in.

7 years agoSwitch to autoconf to find libraries.
Steinar H. Gunderson [Sun, 3 Feb 2013 12:25:32 +0000 (13:25 +0100)]
Switch to autoconf to find libraries.

Also, make a rudimentary make install command.

We don't use anything fancy from autoconf yet (in particular,
no config.h file), and we don't use automake or libtool.
Most likely, this will happen later.

7 years agoRemove obsolete files header.vert and footer.vert.
Steinar H. Gunderson [Sun, 3 Feb 2013 12:18:41 +0000 (13:18 +0100)]
Remove obsolete files header.vert and footer.vert.

7 years agoAdd some missing tests to .gitignore.
Steinar H. Gunderson [Sat, 2 Feb 2013 14:47:23 +0000 (15:47 +0100)]
Add some missing tests to .gitignore.

7 years agoStop linking unit tests et al against SDL_image and other things that only the demo...
Steinar H. Gunderson [Sat, 2 Feb 2013 13:44:26 +0000 (14:44 +0100)]
Stop linking unit tests et al against SDL_image and other things that only the demo program needs.

7 years agoRemove an unused function. Found by Clang.
Steinar H. Gunderson [Sat, 2 Feb 2013 13:34:21 +0000 (14:34 +0100)]
Remove an unused function. Found by Clang.

7 years agoSplit out some private utilities into effect_util.cpp, so we do not need to include...
Steinar H. Gunderson [Sat, 2 Feb 2013 13:32:01 +0000 (14:32 +0100)]
Split out some private utilities into effect_util.cpp, so we do not need to include e.g. Eigen from effect.h.

7 years agoRun include-what-you-use over all of movit. Some hand tuning.
Steinar H. Gunderson [Sat, 2 Feb 2013 13:11:29 +0000 (14:11 +0100)]
Run include-what-you-use over all of movit. Some hand tuning.

7 years agoFix alpha handling for blur; it needs to be on the working (rewritten-to) effect.
Steinar H. Gunderson [Sat, 2 Feb 2013 01:43:08 +0000 (02:43 +0100)]
Fix alpha handling for blur; it needs to be on the working (rewritten-to) effect.

7 years agoAdd a new alpha handling method, INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK.
Steinar H. Gunderson [Sat, 2 Feb 2013 01:35:18 +0000 (02:35 +0100)]
Add a new alpha handling method, INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK.

This should fix most of the problems where you only process inputs
without alpha, but the framework still inserts an AlphaDivisionEffect
at the end because it loses track of the blank alpha state throughout
the pipeline and the output expects postmultiplied alpha.

There's one important case left, though: MixEffect will always reset
tha alpha state to premultiplied. We should probably fix that too
at some later stage.

7 years agoRename the OutputAlphaFormat enums; they had gotten inconsistent after the last alpha...
Steinar H. Gunderson [Sat, 2 Feb 2013 01:18:22 +0000 (02:18 +0100)]
Rename the OutputAlphaFormat enums; they had gotten inconsistent after the last alpha-related rename.

7 years agoGive the alpha enums somewhat better/more consistent names, and shuffle them around...
Steinar H. Gunderson [Fri, 1 Feb 2013 23:38:46 +0000 (00:38 +0100)]
Give the alpha enums somewhat better/more consistent names, and shuffle them around a bit.

7 years agoIn resizing effects, add the notion of a “virtual output size”.
Steinar H. Gunderson [Fri, 1 Feb 2013 00:03:00 +0000 (01:03 +0100)]
In resizing effects, add the notion of a “virtual output size”.

This is the size that the effect wants to be perceived as for the next
effect in the chain, which is useful if you e.g. have a blur and then
padding. Even though the blur might rescale the image down from e.g.
512x512 to 128x128 before blurring (in case of a large blur), and this
size is what actually comes out in the texture at the other end,
it still wants to be treated as a 512x512 image when adding padding.

Reported by Christophe Thommeret.

7 years agoGive SizeStoringEffect an effect_type_id(), for easier debugging of the unit test.
Steinar H. Gunderson [Fri, 1 Feb 2013 00:02:55 +0000 (01:02 +0100)]
Give SizeStoringEffect an effect_type_id(), for easier debugging of the unit test.

7 years agoIf all inputs to an effect have the same input size, use that instead of fitting...
Steinar H. Gunderson [Tue, 29 Jan 2013 19:11:23 +0000 (20:11 +0100)]
If all inputs to an effect have the same input size, use that instead of fitting to the aspect.

The common case here is one-input effects on overlays.
Reported by Christophe Thommeret.

7 years agoFix a Clang warning.
Steinar H. Gunderson [Thu, 24 Jan 2013 09:22:59 +0000 (10:22 +0100)]
Fix a Clang warning.

Patch by Dan Dennedy.

7 years agoFix a bug where intermediate phase outputs could get too low height.
Steinar H. Gunderson [Wed, 23 Jan 2013 23:43:26 +0000 (00:43 +0100)]
Fix a bug where intermediate phase outputs could get too low height.

Basically our aspect ratio adjustment and lack of proper roundoff
could conspire to let e.g. mix(1280x720, 939x939) = 1669x938,
which is obviously wrong. I could probably have fixed it with
an extra lrintf(), but it seems more robust to simply avoid the
extra conversion (ie., never convert height -> width -> height).

Add a unit test to verify.

7 years agoMerge remote-tracking branch 'origin/master'
Steinar H. Gunderson [Tue, 22 Jan 2013 22:59:19 +0000 (23:59 +0100)]
Merge remote-tracking branch 'origin/master'

7 years agoAllow for more than ten bits in subpixel precision measuring; modern llvmpipe seems...
Steinar H. Gunderson [Mon, 21 Jan 2013 23:41:03 +0000 (00:41 +0100)]
Allow for more than ten bits in subpixel precision measuring; modern llvmpipe seems to have 11.

7 years agoDeconvolutionSharpenEffect needs texture bounce.
Steinar H. Gunderson [Mon, 21 Jan 2013 22:29:11 +0000 (23:29 +0100)]
DeconvolutionSharpenEffect needs texture bounce.

Anything else will be incredibly slow. Reported by Christophe Thommeret.

7 years agoFix another stack overflow in EffectChainTest.
Steinar H. Gunderson [Mon, 21 Jan 2013 21:48:42 +0000 (22:48 +0100)]
Fix another stack overflow in EffectChainTest.

Again, found with llvmpipe.

7 years agoLoosen up a boundary in DitherEffectTest by 10%.
Steinar H. Gunderson [Mon, 21 Jan 2013 21:44:24 +0000 (22:44 +0100)]
Loosen up a boundary in DitherEffectTest by 10%.

Seemingly needed on my nVidia machine with the newest drivers.

7 years agoFix a narrowing conversion within {} in PaddingEffect (C++11 compatibility).
Steinar H. Gunderson [Mon, 21 Jan 2013 21:41:18 +0000 (22:41 +0100)]
Fix a narrowing conversion within {} in PaddingEffect (C++11 compatibility).

7 years agoFix a stack overflow in EffectChainTest.
Steinar H. Gunderson [Mon, 21 Jan 2013 21:33:01 +0000 (22:33 +0100)]
Fix a stack overflow in EffectChainTest.

7 years agoIn OverlayEffectTest, handle that RGB on zero alpha is undefined.
Steinar H. Gunderson [Mon, 21 Jan 2013 21:09:51 +0000 (22:09 +0100)]
In OverlayEffectTest, handle that RGB on zero alpha is undefined.

Trickled by llvmpipe.

7 years agoAdd sdl-config --cflags and --libs when compiling.
Steinar H. Gunderson [Mon, 21 Jan 2013 21:04:00 +0000 (22:04 +0100)]
Add sdl-config --cflags and --libs when compiling.

7 years agoCheck return value from SDL_Init().
Steinar H. Gunderson [Mon, 21 Jan 2013 20:44:00 +0000 (21:44 +0100)]
Check return value from SDL_Init().

7 years agoUse NULL instead of png_voidp_NULL.
Steinar H. Gunderson [Mon, 21 Jan 2013 19:55:26 +0000 (20:55 +0100)]
Use NULL instead of png_voidp_NULL.

Fixes a compile error on OS X, reportedly.

7 years agoDon't override GTEST_DIR if it already is set.
Steinar H. Gunderson [Mon, 21 Jan 2013 19:51:22 +0000 (20:51 +0100)]
Don't override GTEST_DIR if it already is set.

7 years agoLink against -lpng, since we can now write screenshots in PNG format.
Steinar H. Gunderson [Mon, 21 Jan 2013 00:42:28 +0000 (01:42 +0100)]
Link against -lpng, since we can now write screenshots in PNG format.

7 years agoAsk Google Test not to use exceptions.
Steinar H. Gunderson [Sun, 20 Jan 2013 01:11:53 +0000 (02:11 +0100)]
Ask Google Test not to use exceptions.

Gives us slightly cleaner shutdown on error. Found by Coverity Scan.

7 years agoMake the internal effects private to EffectChain.
Steinar H. Gunderson [Sun, 20 Jan 2013 01:04:35 +0000 (02:04 +0100)]
Make the internal effects private to EffectChain.

ColorspaceConversionEffect, DitherEffect, GammaExpansionEffect and GammaCompressionEffect
are all supposed to be used by EffectChain only, so make them private; I've had
reports of users trying to use these directly, leaving the framework in a confused state.

7 years agoFix a typo in the README.
Steinar H. Gunderson [Sun, 20 Jan 2013 00:55:47 +0000 (01:55 +0100)]
Fix a typo in the README.

7 years agoAdd some parameter asserts in DitherEffect, too.
Steinar H. Gunderson [Sun, 20 Jan 2013 00:49:27 +0000 (01:49 +0100)]
Add some parameter asserts in DitherEffect, too.

7 years agoRemove two unused members from EffectChain.
Steinar H. Gunderson [Sun, 20 Jan 2013 00:46:36 +0000 (01:46 +0100)]
Remove two unused members from EffectChain.

Indirectly found by Coverity Scan.

7 years agoAnother case of NULL initialization to keep Coverity happy.
Steinar H. Gunderson [Sun, 20 Jan 2013 00:43:25 +0000 (01:43 +0100)]
Another case of NULL initialization to keep Coverity happy.

7 years agoAdd some asserts to SingleResamplePassEffect, to make sure the resolutions makes...
Steinar H. Gunderson [Sun, 20 Jan 2013 00:42:20 +0000 (01:42 +0100)]
Add some asserts to SingleResamplePassEffect, to make sure the resolutions makes sense.

7 years agoOptimize away duplicate conversion nodes.
Steinar H. Gunderson [Sat, 19 Jan 2013 23:31:23 +0000 (00:31 +0100)]
Optimize away duplicate conversion nodes.

Sometimes an effect can be used by two other effects that both demand
the same conversion. If so, we should simply insert a conversion after
that effect and connect _all_ outputs to that conversion, since
conversions to linear/sRGB/premultiplied never hurt for us.

Add unit tests for the gamma and colorspace cases. I could have added
for the alpha case, too, but it got very tedious. :-)

7 years agoSet pixel_data[] to NULL in YCbCrInput as well.
Steinar H. Gunderson [Sat, 19 Jan 2013 22:59:27 +0000 (23:59 +0100)]
Set pixel_data[] to NULL in YCbCrInput as well.

Like the previous one, mainly for cleaner crashes.
Again, found by Coverity Scan.

7 years agoAnother NULL initializer, mostly to get Coverity to be quiet.
Steinar H. Gunderson [Sat, 19 Jan 2013 22:58:51 +0000 (23:58 +0100)]
Another NULL initializer, mostly to get Coverity to be quiet.

7 years agoInitialize pixel_data in FlatInput to NULL.
Steinar H. Gunderson [Sat, 19 Jan 2013 22:54:43 +0000 (23:54 +0100)]
Initialize pixel_data in FlatInput to NULL.

Doesn't matter in practice, but will cause cleaner crashes if people
forget to do set_pixel_data().

Found by Coverity Scan.

7 years agoAdd unit tests for GlowEffect.
Steinar H. Gunderson [Sat, 19 Jan 2013 22:11:33 +0000 (23:11 +0100)]
Add unit tests for GlowEffect.

7 years agoClamp alpha in MixEffect.
Steinar H. Gunderson [Sat, 19 Jan 2013 19:13:51 +0000 (20:13 +0100)]
Clamp alpha in MixEffect.

This struck me suddenly one evening as a fix for the issues with alpha in glow,
and seems to work incredibly well for unsharp mask, too. The rationale is
outlined in the comment in the frag.

I'll probably be adding some tests for GlowEffect to make sure that it keeps
working fine, but visual tests so far look very good. The only issue is that
with destination alpha always being in linear light (as it should be),
programs that don't blend in linear light, like GIMP and ImageMagick,
get somewhat dull-looking results with e.g. glow.

7 years agoForce the LC_NUMERIC locale temporarily to C in finalize(), to avoid problems with...
Steinar H. Gunderson [Fri, 18 Jan 2013 23:04:37 +0000 (00:04 +0100)]
Force the LC_NUMERIC locale temporarily to C in finalize(), to avoid problems with locales messing with %f.

7 years agoWrite PNGs instead of PPMs, so that we get destination alpha. Also, ask SDL for a...
Steinar H. Gunderson [Thu, 17 Jan 2013 20:43:46 +0000 (21:43 +0100)]
Write PNGs instead of PPMs, so that we get destination alpha. Also, ask SDL for a GL context with destination alpha.

7 years agoAdd missing unit test.
Steinar H. Gunderson [Thu, 17 Jan 2013 01:22:24 +0000 (02:22 +0100)]
Add missing unit test.

7 years agoRemove some leftover debugging code.
Steinar H. Gunderson [Thu, 17 Jan 2013 00:54:05 +0000 (01:54 +0100)]
Remove some leftover debugging code.

7 years agoAdd an effect for padding.
Steinar H. Gunderson [Thu, 17 Jan 2013 00:50:36 +0000 (01:50 +0100)]
Add an effect for padding.

7 years agoAdd support for vec4 uniforms.
Steinar H. Gunderson [Thu, 17 Jan 2013 00:49:54 +0000 (01:49 +0100)]
Add support for vec4 uniforms.

7 years agoThere are reports that Movit actually does work with Nouveau.
Steinar H. Gunderson [Wed, 16 Jan 2013 21:14:26 +0000 (22:14 +0100)]
There are reports that Movit actually does work with Nouveau.

7 years agoFix another issue where an input was used twice. Add unit tests, again.
Steinar H. Gunderson [Wed, 16 Jan 2013 20:56:35 +0000 (21:56 +0100)]
Fix another issue where an input was used twice. Add unit tests, again.

7 years agoMake output_dot() cope with effects that are in multiple phases.
Steinar H. Gunderson [Wed, 16 Jan 2013 20:54:06 +0000 (21:54 +0100)]
Make output_dot() cope with effects that are in multiple phases.

7 years agoAdd an assert saying that if an input has premultiplied alpha, it must also have...
Steinar H. Gunderson [Wed, 16 Jan 2013 19:45:14 +0000 (20:45 +0100)]
Add an assert saying that if an input has premultiplied alpha, it must also have linear gamma.

This holds true for nodes in general, but I'm not sure enough about all sorts of intermediate
states that could cause this to be temporarily untrue for other nodes.

7 years agoPrint output node in the dot graphs.
Steinar H. Gunderson [Wed, 16 Jan 2013 19:20:39 +0000 (20:20 +0100)]
Print output node in the dot graphs.

This makes it possible to look at the properties of the last
effect, which is often useful to debug the fix_output_* functions.