Eliminate redundant check in filter_mb_fast, consider bit depth in calculating qp_thresh.
Attach a file by drag & drop or click to upload