Declare all parameter variables as globals rather than in the main().

This reduces the stack size of main() although to the expense of the .bss
section of the ELF file. It also allows for using them directly in the
processing functions.
Simplify detectRotation() function by using the now-global parameters.

This also passes down the mask parameter as an array rather than separate integers.
Pass center and mask as arrays to the centerMask() function.

Reduces the amount of code used for parameters passing.
Use global variable parameters for the detectBorder() function.
Make use of the global variable parameters for the *filter() functions.
Use the global variable parameters for detectMasks().
Remove maskColor parameter to applyWipes.
Make the multiIndex arrays dynamic structures.

This is useful to reduce the size of .bss since we almost never get 100000
different indexes. It also uses dynamic allocations during parsing to avoid
growing over 1MB stack and then reducing.
Only call flipRotate() without branching.
Use global variable parmeters for alignMasks().
Move mask checking into imageprocess.c as inline.

The mask checking was only used in that unit so keep it over there and
inline it. The compiler can easily optimize for this and the result is that
there is no overhead in the inlining.
Remove forward declaration (redundant).
Remove background field from the IMAGE structure.

Now IMAGE is just a pointer to AVFrame.
Get rid of the IMAGE structure and replace it with AVFrame double-pointers.

This changes only the file output functions to not use the double-pointers
but just the read-only single pointer, more will follow.
Remove the freeImage() function.

Instead use av_frame_free() directly.
Make replaceImage an inline function, until it can go away.
Use AVFrame single pointers rather than double pointers.

Most of the functions don't need to modify the pointer, only loading and
canvas-modifying functions need those, everything else only needs to access
the frame.
Avoid duplicating the buffer when stretching and resizing.

Since resizing and stretching are so similar, factor out their base code
without the allocations.
Make the initImage() last parameter a boolean, rather than a colour.

This makes the code simpler because only initImage() needs to access the
global parameter then.
Re-localize two arrays that are only used within a limited scope.