[FFmpeg-cvslog] cavsdec: fix qp fixed slice handling

Michael Niedermayer git at videolan.org
Mon Jun 9 14:43:49 CEST 2014


ffmpeg | branch: zopan | Michael Niedermayer <michaelni at gmx.at> | Mon Jun  9 05:47:49 2014 +0200| [0accf24b15ac5a01a67768f41c896ef4e4b8b4a2] | committer: Michael Niedermayer

cavsdec: fix qp fixed slice handling

Fixes Ticket3400

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

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

 libavcodec/cavs.h    |    1 +
 libavcodec/cavsdec.c |    3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/cavs.h b/libavcodec/cavs.h
index f3c05dc..f851409 100644
--- a/libavcodec/cavs.h
+++ b/libavcodec/cavs.h
@@ -214,6 +214,7 @@ typedef struct AVSContext {
     int luma_scan[4];
     int qp;
     int qp_fixed;
+    int pic_qp_fixed;
     int cbp;
     ScanTable scantable;
 
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index 93d1c59..399b5b9 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -904,7 +904,7 @@ static inline int decode_slice_header(AVSContext *h, GetBitContext *gb)
 
     /* mark top macroblocks as unavailable */
     h->flags &= ~(B_AVAIL | C_AVAIL);
-    if ((h->mby == 0) && (!h->qp_fixed)) {
+    if (!h->pic_qp_fixed) {
         h->qp_fixed = get_bits1(gb);
         h->qp       = get_bits(gb, 6);
     }
@@ -1027,6 +1027,7 @@ static int decode_pic(AVSContext *h)
         skip_bits1(&h->gb);     //advanced_pred_mode_disable
     skip_bits1(&h->gb);        //top_field_first
     skip_bits1(&h->gb);        //repeat_first_field
+    h->pic_qp_fixed =
     h->qp_fixed = get_bits1(&h->gb);
     h->qp       = get_bits(&h->gb, 6);
     if (h->cur.f->pict_type == AV_PICTURE_TYPE_I) {



More information about the ffmpeg-cvslog mailing list