[FFmpeg-cvslog] Merge commit '6e92181bf836f48627a4733b6fd240a99fd36365'

Clément Bœsch git at videolan.org
Fri Jul 1 14:23:28 CEST 2016


ffmpeg | branch: master | Clément Bœsch <clement at stupeflix.com> | Fri Jul  1 14:23:38 2016 +0200| [5565e271116215a968eec2ac260b91ebe1768f0f] | committer: Clément Bœsch

Merge commit '6e92181bf836f48627a4733b6fd240a99fd36365'

* commit '6e92181bf836f48627a4733b6fd240a99fd36365':
  h264: pass just the PPS to get_chroma_qp()

Merged-by: Clément Bœsch <clement at stupeflix.com>

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

 libavcodec/h264.h            |    4 ++--
 libavcodec/h264_cabac.c      |    4 ++--
 libavcodec/h264_cavlc.c      |    4 ++--
 libavcodec/h264_loopfilter.c |   30 +++++++++++++++---------------
 libavcodec/h264_slice.c      |   12 ++++++------
 5 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index 3f2244b..078105c 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -838,9 +838,9 @@ static av_always_inline uint16_t pack8to16(unsigned a, unsigned b)
 /**
  * Get the chroma qp.
  */
-static av_always_inline int get_chroma_qp(const H264Context *h, int t, int qscale)
+static av_always_inline int get_chroma_qp(const PPS *pps, int t, int qscale)
 {
-    return h->ps.pps->chroma_qp_table[t][qscale];
+    return pps->chroma_qp_table[t][qscale];
 }
 
 /**
diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c
index eec1aa1..c8523af 100644
--- a/libavcodec/h264_cabac.c
+++ b/libavcodec/h264_cabac.c
@@ -2403,8 +2403,8 @@ decode_intra_mb:
                 if (sl->qscale < 0) sl->qscale += max_qp + 1;
                 else                sl->qscale -= max_qp + 1;
             }
-            sl->chroma_qp[0] = get_chroma_qp(h, 0, sl->qscale);
-            sl->chroma_qp[1] = get_chroma_qp(h, 1, sl->qscale);
+            sl->chroma_qp[0] = get_chroma_qp(h->ps.pps, 0, sl->qscale);
+            sl->chroma_qp[1] = get_chroma_qp(h->ps.pps, 1, sl->qscale);
         }else
             sl->last_qscale_diff=0;
 
diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c
index 3293c66..16b079e 100644
--- a/libavcodec/h264_cavlc.c
+++ b/libavcodec/h264_cavlc.c
@@ -1123,8 +1123,8 @@ decode_intra_mb:
             }
         }
 
-        sl->chroma_qp[0] = get_chroma_qp(h, 0, sl->qscale);
-        sl->chroma_qp[1] = get_chroma_qp(h, 1, sl->qscale);
+        sl->chroma_qp[0] = get_chroma_qp(h->ps.pps, 0, sl->qscale);
+        sl->chroma_qp[1] = get_chroma_qp(h->ps.pps, 1, sl->qscale);
 
         if ((ret = decode_luma_residual(h, sl, gb, scan, scan8x8, pixel_shift, mb_type, cbp, 0)) < 0 ) {
             return -1;
diff --git a/libavcodec/h264_loopfilter.c b/libavcodec/h264_loopfilter.c
index 0ef0c12..62a82c9 100644
--- a/libavcodec/h264_loopfilter.c
+++ b/libavcodec/h264_loopfilter.c
@@ -258,9 +258,9 @@ static av_always_inline void h264_filter_mb_fast_internal(const H264Context *h,
     int qp      = h->cur_pic.qscale_table[mb_xy];
     int qp0     = h->cur_pic.qscale_table[mb_xy - 1];
     int qp1     = h->cur_pic.qscale_table[sl->top_mb_xy];
-    int qpc = get_chroma_qp( h, 0, qp );
-    int qpc0 = get_chroma_qp( h, 0, qp0 );
-    int qpc1 = get_chroma_qp( h, 0, qp1 );
+    int qpc  = get_chroma_qp(h->ps.pps, 0, qp);
+    int qpc0 = get_chroma_qp(h->ps.pps, 0, qp0);
+    int qpc1 = get_chroma_qp(h->ps.pps, 0, qp1);
     qp0 = (qp + qp0 + 1) >> 1;
     qp1 = (qp + qp1 + 1) >> 1;
     qpc0 = (qpc + qpc0 + 1) >> 1;
@@ -529,8 +529,8 @@ static av_always_inline void filter_mb_dir(const H264Context *h, H264SliceContex
                 ff_tlog(h->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, tmp_linesize, tmp_uvlinesize);
                 { int i; for (i = 0; i < 4; i++) ff_tlog(h->avctx, " bS[%d]:%d", i, bS[i]); ff_tlog(h->avctx, "\n"); }
                 filter_mb_edgeh( &img_y[j*linesize], tmp_linesize, bS, qp, a, b, h, 0 );
-                chroma_qp_avg[0] = (sl->chroma_qp[0] + get_chroma_qp(h, 0, h->cur_pic.qscale_table[mbn_xy]) + 1) >> 1;
-                chroma_qp_avg[1] = (sl->chroma_qp[1] + get_chroma_qp(h, 1, h->cur_pic.qscale_table[mbn_xy]) + 1) >> 1;
+                chroma_qp_avg[0] = (sl->chroma_qp[0] + get_chroma_qp(h->ps.pps, 0, h->cur_pic.qscale_table[mbn_xy]) + 1) >> 1;
+                chroma_qp_avg[1] = (sl->chroma_qp[1] + get_chroma_qp(h->ps.pps, 1, h->cur_pic.qscale_table[mbn_xy]) + 1) >> 1;
                 if (chroma) {
                     if (chroma444) {
                         filter_mb_edgeh (&img_cb[j*uvlinesize], tmp_uvlinesize, bS, chroma_qp_avg[0], a, b, h, 0);
@@ -594,8 +594,8 @@ static av_always_inline void filter_mb_dir(const H264Context *h, H264SliceContex
                 //ff_tlog(h->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d, QPc:%d, QPcn:%d\n", mb_x, mb_y, dir, edge, qp, h->chroma_qp[0], h->cur_pic.qscale_table[mbn_xy]);
                 ff_tlog(h->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, linesize, uvlinesize);
                 //{ int i; for (i = 0; i < 4; i++) ff_tlog(h->avctx, " bS[%d]:%d", i, bS[i]); ff_tlog(h->avctx, "\n"); }
-                chroma_qp_avg[0] = (sl->chroma_qp[0] + get_chroma_qp(h, 0, h->cur_pic.qscale_table[mbm_xy]) + 1) >> 1;
-                chroma_qp_avg[1] = (sl->chroma_qp[1] + get_chroma_qp(h, 1, h->cur_pic.qscale_table[mbm_xy]) + 1) >> 1;
+                chroma_qp_avg[0] = (sl->chroma_qp[0] + get_chroma_qp(h->ps.pps, 0, h->cur_pic.qscale_table[mbm_xy]) + 1) >> 1;
+                chroma_qp_avg[1] = (sl->chroma_qp[1] + get_chroma_qp(h->ps.pps, 1, h->cur_pic.qscale_table[mbm_xy]) + 1) >> 1;
                 if( dir == 0 ) {
                     filter_mb_edgev( &img_y[0], linesize, bS, qp, a, b, h, 1 );
                     if (chroma) {
@@ -779,15 +779,15 @@ void ff_h264_filter_mb(const H264Context *h, H264SliceContext *sl,
         mbn0_qp = h->cur_pic.qscale_table[sl->left_mb_xy[0]];
         mbn1_qp = h->cur_pic.qscale_table[sl->left_mb_xy[1]];
         qp[0] = ( mb_qp + mbn0_qp + 1 ) >> 1;
-        bqp[0] = ( get_chroma_qp( h, 0, mb_qp ) +
-                   get_chroma_qp( h, 0, mbn0_qp ) + 1 ) >> 1;
-        rqp[0] = ( get_chroma_qp( h, 1, mb_qp ) +
-                   get_chroma_qp( h, 1, mbn0_qp ) + 1 ) >> 1;
+        bqp[0] = (get_chroma_qp(h->ps.pps, 0, mb_qp) +
+                  get_chroma_qp(h->ps.pps, 0, mbn0_qp) + 1) >> 1;
+        rqp[0] = (get_chroma_qp(h->ps.pps, 1, mb_qp) +
+                  get_chroma_qp(h->ps.pps, 1, mbn0_qp) + 1) >> 1;
         qp[1] = ( mb_qp + mbn1_qp + 1 ) >> 1;
-        bqp[1] = ( get_chroma_qp( h, 0, mb_qp ) +
-                   get_chroma_qp( h, 0, mbn1_qp ) + 1 ) >> 1;
-        rqp[1] = ( get_chroma_qp( h, 1, mb_qp ) +
-                   get_chroma_qp( h, 1, mbn1_qp ) + 1 ) >> 1;
+        bqp[1] = (get_chroma_qp(h->ps.pps, 0, mb_qp) +
+                  get_chroma_qp(h->ps.pps, 0, mbn1_qp) + 1 ) >> 1;
+        rqp[1] = (get_chroma_qp(h->ps.pps, 1, mb_qp) +
+                  get_chroma_qp(h->ps.pps, 1, mbn1_qp) + 1 ) >> 1;
 
         /* Filter edge */
         ff_tlog(h->avctx, "filter mb:%d/%d MBAFF, QPy:%d/%d, QPb:%d/%d QPr:%d/%d ls:%d uvls:%d", mb_x, mb_y, qp[0], qp[1], bqp[0], bqp[1], rqp[0], rqp[1], linesize, uvlinesize);
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 30594c1..427554c 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1593,8 +1593,8 @@ static int h264_slice_header_parse(H264Context *h, H264SliceContext *sl)
         return AVERROR_INVALIDDATA;
     }
     sl->qscale       = tmp;
-    sl->chroma_qp[0] = get_chroma_qp(h, 0, sl->qscale);
-    sl->chroma_qp[1] = get_chroma_qp(h, 1, sl->qscale);
+    sl->chroma_qp[0] = get_chroma_qp(pps, 0, sl->qscale);
+    sl->chroma_qp[1] = get_chroma_qp(pps, 1, sl->qscale);
     // FIXME qscale / qp ... stuff
     if (sl->slice_type == AV_PICTURE_TYPE_SP)
         get_bits1(&sl->gb); /* sp_for_switch_flag */
@@ -2085,8 +2085,8 @@ static void loop_filter(const H264Context *h, H264SliceContext *sl, int start_x,
                                  uvlinesize, 0);
                 if (fill_filter_caches(h, sl, mb_type))
                     continue;
-                sl->chroma_qp[0] = get_chroma_qp(h, 0, h->cur_pic.qscale_table[mb_xy]);
-                sl->chroma_qp[1] = get_chroma_qp(h, 1, h->cur_pic.qscale_table[mb_xy]);
+                sl->chroma_qp[0] = get_chroma_qp(h->ps.pps, 0, h->cur_pic.qscale_table[mb_xy]);
+                sl->chroma_qp[1] = get_chroma_qp(h->ps.pps, 1, h->cur_pic.qscale_table[mb_xy]);
 
                 if (FRAME_MBAFF(h)) {
                     ff_h264_filter_mb(h, sl, mb_x, mb_y, dest_y, dest_cb, dest_cr,
@@ -2100,8 +2100,8 @@ static void loop_filter(const H264Context *h, H264SliceContext *sl, int start_x,
     sl->slice_type  = old_slice_type;
     sl->mb_x         = end_x;
     sl->mb_y         = end_mb_y - FRAME_MBAFF(h);
-    sl->chroma_qp[0] = get_chroma_qp(h, 0, sl->qscale);
-    sl->chroma_qp[1] = get_chroma_qp(h, 1, sl->qscale);
+    sl->chroma_qp[0] = get_chroma_qp(h->ps.pps, 0, sl->qscale);
+    sl->chroma_qp[1] = get_chroma_qp(h->ps.pps, 1, sl->qscale);
 }
 
 static void predict_field_decoding_flag(const H264Context *h, H264SliceContext *sl)


======================================================================

diff --cc libavcodec/h264_loopfilter.c
index 0ef0c12,2bac17a..62a82c9
--- a/libavcodec/h264_loopfilter.c
+++ b/libavcodec/h264_loopfilter.c
@@@ -591,11 -593,9 +591,11 @@@ static av_always_inline void filter_mb_
              // value in IPCM macroblocks.
              if(bS[0]+bS[1]+bS[2]+bS[3]){
                  qp = (h->cur_pic.qscale_table[mb_xy] + h->cur_pic.qscale_table[mbm_xy] + 1) >> 1;
 +                //ff_tlog(h->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d, QPc:%d, QPcn:%d\n", mb_x, mb_y, dir, edge, qp, h->chroma_qp[0], h->cur_pic.qscale_table[mbn_xy]);
                  ff_tlog(h->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, linesize, uvlinesize);
 +                //{ int i; for (i = 0; i < 4; i++) ff_tlog(h->avctx, " bS[%d]:%d", i, bS[i]); ff_tlog(h->avctx, "\n"); }
-                 chroma_qp_avg[0] = (sl->chroma_qp[0] + get_chroma_qp(h, 0, h->cur_pic.qscale_table[mbm_xy]) + 1) >> 1;
-                 chroma_qp_avg[1] = (sl->chroma_qp[1] + get_chroma_qp(h, 1, h->cur_pic.qscale_table[mbm_xy]) + 1) >> 1;
+                 chroma_qp_avg[0] = (sl->chroma_qp[0] + get_chroma_qp(h->ps.pps, 0, h->cur_pic.qscale_table[mbm_xy]) + 1) >> 1;
+                 chroma_qp_avg[1] = (sl->chroma_qp[1] + get_chroma_qp(h->ps.pps, 1, h->cur_pic.qscale_table[mbm_xy]) + 1) >> 1;
                  if( dir == 0 ) {
                      filter_mb_edgev( &img_y[0], linesize, bS, qp, a, b, h, 1 );
                      if (chroma) {



More information about the ffmpeg-cvslog mailing list