Revision f311208c libavcodec/vp8.c

View differences:

libavcodec/vp8.c
868 868
    int i, x, y, luma_start = 0, luma_ctx = 3;
869 869
    int nnz_pred, nnz, nnz_total = 0;
870 870
    int segment = s->segment;
871
    int block_dc = 0;
871 872

  
872 873
    if (mb->mode != MODE_I4x4 && mb->mode != VP8_MVMODE_SPLIT) {
873 874
        nnz_pred = t_nnz[8] + l_nnz[8];
......
876 877
        nnz = decode_block_coeffs(c, s->block_dc, s->prob->token[1], 0, nnz_pred,
877 878
                                  s->qmat[segment].luma_dc_qmul);
878 879
        l_nnz[8] = t_nnz[8] = !!nnz;
879
        nnz_total += nnz;
880
        s->vp8dsp.vp8_luma_dc_wht(s->block, s->block_dc);
880
        if (nnz) {
881
            nnz_total += nnz;
882
            block_dc = 1;
883
            if (nnz == 1)
884
                s->vp8dsp.vp8_luma_dc_wht_dc(s->block, s->block_dc);
885
            else
886
                s->vp8dsp.vp8_luma_dc_wht(s->block, s->block_dc);
887
        }
881 888
        luma_start = 1;
882 889
        luma_ctx = 0;
883 890
    }
......
888 895
            nnz_pred = l_nnz[y] + t_nnz[x];
889 896
            nnz = decode_block_coeffs(c, s->block[y][x], s->prob->token[luma_ctx], luma_start,
890 897
                                      nnz_pred, s->qmat[segment].luma_qmul);
891
            // nnz+luma_start may be one more than the actual last index, but we don't care
892
            s->non_zero_count_cache[y][x] = nnz + luma_start;
898
            // nnz+block_dc may be one more than the actual last index, but we don't care
899
            s->non_zero_count_cache[y][x] = nnz + block_dc;
893 900
            t_nnz[x] = l_nnz[y] = !!nnz;
894 901
            nnz_total += nnz;
895 902
        }

Also available in: Unified diff