[FFmpeg-cvslog] avcodec/h264_slice: Use AVFrame diemensions for grayscale handling

Michael Niedermayer git at videolan.org
Wed Jun 10 11:51:41 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Jun 10 11:37:48 2015 +0200| [aef0e0f009802f1a5e21eb6465498632071e4475] | committer: Michael Niedermayer

avcodec/h264_slice: Use AVFrame diemensions for grayscale handling

The AVFrame values are closer to the AVFrame bitmap changed instead of
the AVCodecContext values, so this should be more robust

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

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=aef0e0f009802f1a5e21eb6465498632071e4475
---

 libavcodec/h264_slice.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index f12e4b7..9c4d613 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -251,11 +251,11 @@ static int alloc_picture(H264Context *h, H264Picture *pic)
         av_pix_fmt_get_chroma_sub_sample(pic->f->format,
                                          &h_chroma_shift, &v_chroma_shift);
 
-        for(i=0; i<FF_CEIL_RSHIFT(h->avctx->height, v_chroma_shift); i++) {
+        for(i=0; i<FF_CEIL_RSHIFT(pic->f->height, v_chroma_shift); i++) {
             memset(pic->f->data[1] + pic->f->linesize[1]*i,
-                   0x80, FF_CEIL_RSHIFT(h->avctx->width, h_chroma_shift));
+                   0x80, FF_CEIL_RSHIFT(pic->f->width, h_chroma_shift));
             memset(pic->f->data[2] + pic->f->linesize[2]*i,
-                   0x80, FF_CEIL_RSHIFT(h->avctx->width, h_chroma_shift));
+                   0x80, FF_CEIL_RSHIFT(pic->f->width, h_chroma_shift));
         }
     }
 



More information about the ffmpeg-cvslog mailing list