mpeg12enc: factor out check in encode_dc

Makes coverity less confused and the code more readable.

CC: libav-stable@libav.org
Bug-Id: CID 751744
pull/94/head
Vittorio Giovara 10 years ago
parent 0a66647061
commit 37b3361e75
  1. 3
      libavcodec/mpeg12enc.c

@ -546,7 +546,8 @@ static void mpeg1_encode_motion(MpegEncContext *s, int val, int f_or_b_code)
static inline void encode_dc(MpegEncContext *s, int diff, int component)
{
if (((unsigned) (diff + 255)) >= 511) {
unsigned int diff_u = diff + 255;
if (diff_u >= 511) {
int index;
if (diff < 0) {

Loading…
Cancel
Save