Browse Source

Fix width computation for nv12/nv21 in ff_get_plane_bytewidth().

Originally committed as revision 23507 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/n0.8
Stefano Sabatini 15 years ago
parent
commit
2839c56ea6
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      libavcodec/imgconvert.c

+ 2
- 1
libavcodec/imgconvert.c View File

@@ -948,7 +948,8 @@ int ff_get_plane_bytewidth(enum PixelFormat pix_fmt, int width, int plane)
return (width * bits + 7) >> 3;
break;
case FF_PIXEL_PLANAR:
if (plane == 1 || plane == 2)
if ((pix_fmt != PIX_FMT_NV12 && pix_fmt != PIX_FMT_NV21) &&
(plane == 1 || plane == 2))
width= -((-width)>>desc->log2_chroma_w);

return (width * pf->depth + 7) >> 3;


Loading…
Cancel
Save