avcodec/h264_refs: split conditions of if() up for better readability

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/h264_refs: improve key frame detection heuristic

Fixes Ticket3186

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