avfilter/af_compand: merge avframe code from af_compand_fork

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>