Revision 0c32e19d libavcodec/h264.c

View differences:

libavcodec/h264.c
2032 2032
    }
2033 2033

  
2034 2034
    h->deblocking_filter = 1;
2035
    h->slice_alpha_c0_offset = 0;
2036
    h->slice_beta_offset = 0;
2035
    h->slice_alpha_c0_offset = 52;
2036
    h->slice_beta_offset = 52;
2037 2037
    if( h->pps.deblocking_filter_parameters_present ) {
2038 2038
        tmp= get_ue_golomb_31(&s->gb);
2039 2039
        if(tmp > 2){
......
2045 2045
            h->deblocking_filter^= 1; // 1<->0
2046 2046

  
2047 2047
        if( h->deblocking_filter ) {
2048
            h->slice_alpha_c0_offset = get_se_golomb(&s->gb) << 1;
2049
            h->slice_beta_offset = get_se_golomb(&s->gb) << 1;
2048
            h->slice_alpha_c0_offset += get_se_golomb(&s->gb) << 1;
2049
            h->slice_beta_offset     += get_se_golomb(&s->gb) << 1;
2050
            if(   h->slice_alpha_c0_offset > 104U
2051
               || h->slice_beta_offset     > 104U){
2052
                av_log(s->avctx, AV_LOG_ERROR, "deblocking filter parameters %d %d out of range\n", h->slice_alpha_c0_offset, h->slice_beta_offset);
2053
                return -1;
2054
            }
2050 2055
        }
2051 2056
    }
2052 2057

  
......
2071 2076
                return 1; // deblocking switched inside frame
2072 2077
        }
2073 2078
    }
2074
    h->qp_thresh= 15 - FFMIN(h->slice_alpha_c0_offset, h->slice_beta_offset) - FFMAX3(0, h->pps.chroma_qp_index_offset[0], h->pps.chroma_qp_index_offset[1]);
2079
    h->qp_thresh= 15 + 52 - FFMIN(h->slice_alpha_c0_offset, h->slice_beta_offset) - FFMAX3(0, h->pps.chroma_qp_index_offset[0], h->pps.chroma_qp_index_offset[1]);
2075 2080

  
2076 2081
#if 0 //FMO
2077 2082
    if( h->pps.num_slice_groups > 1  && h->pps.mb_slice_group_map_type >= 3 && h->pps.mb_slice_group_map_type <= 5)
......
2132 2137
               s->current_picture_ptr->field_poc[0], s->current_picture_ptr->field_poc[1],
2133 2138
               h->ref_count[0], h->ref_count[1],
2134 2139
               s->qscale,
2135
               h->deblocking_filter, h->slice_alpha_c0_offset/2, h->slice_beta_offset/2,
2140
               h->deblocking_filter, h->slice_alpha_c0_offset/2-26, h->slice_beta_offset/2-26,
2136 2141
               h->use_weight,
2137 2142
               h->use_weight==1 && h->use_weight_chroma ? "c" : "",
2138 2143
               h->slice_type == FF_B_TYPE ? (h->direct_spatial_mv_pred ? "SPAT" : "TEMP") : ""

Also available in: Unified diff