avfilter/vf_histogram: improve waveform speed

Signed-off-by: Marton Balint <cus@passwd.hu>
avfilter/vf_histogram: add support for subsampled planar yuv modes in waveform mode

Signed-off-by: Marton Balint <cus@passwd.hu>
avfilter/vf_histogram: change order of histograms for planar rgb

Signed-off-by: Paul B Mahol <onemda@gmail.com>
Revert "Merge commit '61c31e4ee7ea79a9e74c0476b81244febf17e6d7'" (configure: Properly set zlib dependencies for all components)

The reverted commit introduced undefined behavior.
undefined in the sense that the evaluation order of the dependencies affects the results

Fixes Ticket2920

This reverts commit c32db6adab9942781cc5a23f62abb839a5595a83, reversing
changes made to 05f1b4e2ecc4683467669a190e3a53df413de805.

Alternative solutions would be to change the dependency solver to handle non trivial
dependencies or to enable zlib by default before the dependency solver, this would
leave a zlib dependency in the libs though then even when no zlib is needed or used.