[FFmpeg-cvslog] hevc: do not store pcm_flag in the context

Anton Khirnov git at videolan.org
Mon Nov 17 11:19:31 CET 2014


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Nov 15 20:00:22 2014 +0100| [920bca3e2332dced9c78bd14cfc2ff138188bd57] | committer: Anton Khirnov

hevc: do not store pcm_flag in the context

It does not need to be accessed outside of hls_coding_unit().

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

 libavcodec/hevc.c |    9 +++++----
 libavcodec/hevc.h |    2 --
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 9b3d339..5dbcc70 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -2065,7 +2065,6 @@ static int hls_coding_unit(HEVCContext *s, int x0, int y0, int log2_cb_size)
     lc->cu.pred_mode        = MODE_INTRA;
     lc->cu.part_mode        = PART_2Nx2N;
     lc->cu.intra_split_flag = 0;
-    lc->cu.pcm_flag         = 0;
 
     SAMPLE_CTB(s->skip_flag, x_cb, y_cb) = 0;
     for (x = 0; x < 4; x++)
@@ -2096,6 +2095,8 @@ static int hls_coding_unit(HEVCContext *s, int x0, int y0, int log2_cb_size)
         if (!s->sh.disable_deblocking_filter_flag)
             ff_hevc_deblocking_boundary_strengths(s, x0, y0, log2_cb_size);
     } else {
+        int pcm_flag = 0;
+
         if (s->sh.slice_type != I_SLICE)
             lc->cu.pred_mode = ff_hevc_pred_mode_decode(s);
         if (lc->cu.pred_mode != MODE_INTRA ||
@@ -2109,9 +2110,9 @@ static int hls_coding_unit(HEVCContext *s, int x0, int y0, int log2_cb_size)
             if (lc->cu.part_mode == PART_2Nx2N && s->sps->pcm_enabled_flag &&
                 log2_cb_size >= s->sps->pcm.log2_min_pcm_cb_size &&
                 log2_cb_size <= s->sps->pcm.log2_max_pcm_cb_size) {
-                lc->cu.pcm_flag = ff_hevc_pcm_flag_decode(s);
+                pcm_flag = ff_hevc_pcm_flag_decode(s);
             }
-            if (lc->cu.pcm_flag) {
+            if (pcm_flag) {
                 intra_prediction_unit_default_value(s, x0, y0, log2_cb_size);
                 ret = hls_pcm_sample(s, x0, y0, log2_cb_size);
                 if (s->sps->pcm.loop_filter_disable_flag)
@@ -2161,7 +2162,7 @@ static int hls_coding_unit(HEVCContext *s, int x0, int y0, int log2_cb_size)
             }
         }
 
-        if (!lc->cu.pcm_flag) {
+        if (!pcm_flag) {
             if (lc->cu.pred_mode != MODE_INTRA &&
                 !(lc->cu.part_mode == PART_2Nx2N && lc->pu.merge_flag)) {
                 lc->cu.rqt_root_cbf = ff_hevc_no_residual_syntax_flag_decode(s);
diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h
index 93c5125..2cc2608 100644
--- a/libavcodec/hevc.h
+++ b/libavcodec/hevc.h
@@ -607,8 +607,6 @@ typedef struct CodingUnit {
 
     uint8_t rqt_root_cbf;
 
-    uint8_t pcm_flag;
-
     // Inferred parameters
     uint8_t intra_split_flag;   ///< IntraSplitFlag
     uint8_t max_trafo_depth;    ///< MaxTrafoDepth



More information about the ffmpeg-cvslog mailing list