avfilter: port qp filter from libmpcodecs