Browse Source

yuv4mpegenc: Use AV_CEIL_RSHIFT where needed

tags/n3.1
Vittorio Giovara 10 years ago
parent
commit
e80307140f
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavformat/yuv4mpegenc.c

+ 2
- 2
libavformat/yuv4mpegenc.c View File

@@ -129,8 +129,8 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt)
av_pix_fmt_get_chroma_sub_sample(st->codec->pix_fmt, &h_chroma_shift, av_pix_fmt_get_chroma_sub_sample(st->codec->pix_fmt, &h_chroma_shift,
&v_chroma_shift); &v_chroma_shift);
// Shift right, rounding up // Shift right, rounding up
width = -(-width >> h_chroma_shift);
height = -(-height >> v_chroma_shift);
width = AV_CEIL_RSHIFT(width, h_chroma_shift);
height = AV_CEIL_RSHIFT(height, v_chroma_shift);


ptr1 = frame->data[1]; ptr1 = frame->data[1];
ptr2 = frame->data[2]; ptr2 = frame->data[2];


Loading…
Cancel
Save