Merge commit '0daa2554636ba1d31f3162ffb86991e84eb938a8'
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 28 Jul 2014 11:09:00 +0000 (13:09 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 28 Jul 2014 11:09:28 +0000 (13:09 +0200)
* commit '0daa2554636ba1d31f3162ffb86991e84eb938a8':
  hevc: do not store the transform inter_split flag in the context

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/hevc.c
libavcodec/hevc.h

@@@ -1124,30 -1367,27 +1119,35 @@@ static int hls_transform_tree(HEVCConte
          !(lc->cu.intra_split_flag && trafo_depth == 0)) {
          split_transform_flag = ff_hevc_split_transform_flag_decode(s, log2_trafo_size);
      } else {
+         int inter_split = s->sps->max_transform_hierarchy_depth_inter == 0 &&
+                           lc->cu.pred_mode == MODE_INTER &&
+                           lc->cu.part_mode != PART_2Nx2N &&
+                           trafo_depth == 0;
          split_transform_flag = log2_trafo_size > s->sps->log2_max_trafo_size ||
                                 (lc->cu.intra_split_flag && trafo_depth == 0) ||
-                                lc->tt.inter_split_flag;
+                                inter_split;
      }
  
 -    if (log2_trafo_size > 2) {
 -        if (trafo_depth == 0 ||
 -            SAMPLE_CBF(lc->tt.cbf_cb[trafo_depth - 1], xBase, yBase)) {
 -            SAMPLE_CBF(lc->tt.cbf_cb[trafo_depth], x0, y0) =
 -                ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
 +    if (log2_trafo_size > 2 || s->sps->chroma_format_idc == 3) {
 +        if (trafo_depth == 0 || cbf_cb[0]) {
 +            cbf_cb[0] = ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
 +            if (s->sps->chroma_format_idc == 2 && (!split_transform_flag || log2_trafo_size == 3)) {
 +                cbf_cb[1] = ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
 +            }
 +        } else if (trafo_depth == 0) {
 +            cbf_cb[0] =
 +            cbf_cb[1] = 0;
          }
  
 -        if (trafo_depth == 0 ||
 -            SAMPLE_CBF(lc->tt.cbf_cr[trafo_depth - 1], xBase, yBase)) {
 -            SAMPLE_CBF(lc->tt.cbf_cr[trafo_depth], x0, y0) =
 -                ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
 +        if (trafo_depth == 0 || cbf_cr[0]) {
 +            cbf_cr[0] = ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
 +            if (s->sps->chroma_format_idc == 2 && (!split_transform_flag || log2_trafo_size == 3)) {
 +                cbf_cr[1] = ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
 +            }
 +        } else if (trafo_depth == 0) {
 +            cbf_cr[0] =
 +            cbf_cr[1] = 0;
          }
      }
  
@@@ -684,10 -647,9 +684,7 @@@ typedef struct PredictionUnit 
  } PredictionUnit;
  
  typedef struct TransformTree {
 -    uint8_t cbf_cb[MAX_TRANSFORM_DEPTH][MAX_CU_SIZE * MAX_CU_SIZE];
 -    uint8_t cbf_cr[MAX_TRANSFORM_DEPTH][MAX_CU_SIZE * MAX_CU_SIZE];
      uint8_t cbf_luma;
-     // Inferred parameters
-     uint8_t inter_split_flag;
  } TransformTree;
  
  typedef struct TransformUnit {