[PATCH 10/10] Fix width computation for nv12/nv21 in ff_get_plane_bytewidth().
Stefano Sabatini
stefano.sabatini-lala
Sun Jun 6 00:19:27 CEST 2010
---
libavcodec/imgconvert.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
index 8f789c4..4984f2c 100644
--- a/libavcodec/imgconvert.c
+++ b/libavcodec/imgconvert.c
@@ -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;
--
1.7.1
--dDRMvlgZJXvWKvBx--
More information about the ffmpeg-devel
mailing list