Revision ce5e49b0 libavcodec/snow.c

View differences:

libavcodec/snow.c
2074 2074
    ff_init_range_decoder(c, buf, buf_size);
2075 2075
    ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
2076 2076

  
2077
    s->current_picture.pict_type= FF_I_TYPE; //FIXME I vs. P
2077
    s->current_picture.pict_type= AV_PICTURE_TYPE_I; //FIXME I vs. P
2078 2078
    if(decode_header(s)<0)
2079 2079
        return -1;
2080 2080
    common_init_after_header(avctx);
......
3651 3651
    coef_sum = (uint64_t)coef_sum * coef_sum >> 16;
3652 3652
    assert(coef_sum < INT_MAX);
3653 3653

  
3654
    if(pict->pict_type == FF_I_TYPE){
3654
    if(pict->pict_type == AV_PICTURE_TYPE_I){
3655 3655
        s->m.current_picture.mb_var_sum= coef_sum;
3656 3656
        s->m.current_picture.mc_mb_var_sum= 0;
3657 3657
    }else{
......
3720 3720
    if(avctx->flags&CODEC_FLAG_PASS2){
3721 3721
        s->m.pict_type =
3722 3722
        pict->pict_type= s->m.rc_context.entry[avctx->frame_number].new_pict_type;
3723
        s->keyframe= pict->pict_type==FF_I_TYPE;
3723
        s->keyframe= pict->pict_type==AV_PICTURE_TYPE_I;
3724 3724
        if(!(avctx->flags&CODEC_FLAG_QSCALE)) {
3725 3725
            pict->quality= ff_rate_estimate_qscale(&s->m, 0);
3726 3726
            if (pict->quality < 0)
......
3729 3729
    }else{
3730 3730
        s->keyframe= avctx->gop_size==0 || avctx->frame_number % avctx->gop_size == 0;
3731 3731
        s->m.pict_type=
3732
        pict->pict_type= s->keyframe ? FF_I_TYPE : FF_P_TYPE;
3732
        pict->pict_type= s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
3733 3733
    }
3734 3734

  
3735 3735
    if(s->pass1_rc && avctx->frame_number == 0)
......
3748 3748
    s->m.current_picture_ptr= &s->m.current_picture;
3749 3749
    s->m.last_picture.pts= s->m.current_picture.pts;
3750 3750
    s->m.current_picture.pts= pict->pts;
3751
    if(pict->pict_type == FF_P_TYPE){
3751
    if(pict->pict_type == AV_PICTURE_TYPE_P){
3752 3752
        int block_width = (width +15)>>4;
3753 3753
        int block_height= (height+15)>>4;
3754 3754
        int stride= s->current_picture.linesize[0];
......
3797 3797

  
3798 3798
redo_frame:
3799 3799

  
3800
    if(pict->pict_type == FF_I_TYPE)
3800
    if(pict->pict_type == AV_PICTURE_TYPE_I)
3801 3801
        s->spatial_decomposition_count= 5;
3802 3802
    else
3803 3803
        s->spatial_decomposition_count= 5;
3804 3804

  
3805 3805
    s->m.pict_type = pict->pict_type;
3806
    s->qbias= pict->pict_type == FF_P_TYPE ? 2 : 0;
3806
    s->qbias= pict->pict_type == AV_PICTURE_TYPE_P ? 2 : 0;
3807 3807

  
3808 3808
    common_init_after_header(avctx);
3809 3809

  
......
3836 3836
            predict_plane(s, s->spatial_idwt_buffer, plane_index, 0);
3837 3837

  
3838 3838
            if(   plane_index==0
3839
               && pict->pict_type == FF_P_TYPE
3839
               && pict->pict_type == AV_PICTURE_TYPE_P
3840 3840
               && !(avctx->flags&CODEC_FLAG_PASS2)
3841 3841
               && s->m.me.scene_change_score > s->avctx->scenechange_threshold){
3842 3842
                ff_init_range_encoder(c, buf, buf_size);
3843 3843
                ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
3844
                pict->pict_type= FF_I_TYPE;
3844
                pict->pict_type= AV_PICTURE_TYPE_I;
3845 3845
                s->keyframe=1;
3846 3846
                s->current_picture.key_frame=1;
3847 3847
                goto redo_frame;
......
3887 3887
                    if(!QUANTIZE2)
3888 3888
                        quantize(s, b, b->ibuf, b->buf, b->stride, s->qbias);
3889 3889
                    if(orientation==0)
3890
                        decorrelate(s, b, b->ibuf, b->stride, pict->pict_type == FF_P_TYPE, 0);
3890
                        decorrelate(s, b, b->ibuf, b->stride, pict->pict_type == AV_PICTURE_TYPE_P, 0);
3891 3891
                    encode_subband(s, b, b->ibuf, b->parent ? b->parent->ibuf : NULL, b->stride, orientation);
3892 3892
                    assert(b->parent==NULL || b->parent->stride == b->stride*2);
3893 3893
                    if(orientation==0)
......
3914 3914
            predict_plane(s, s->spatial_idwt_buffer, plane_index, 1);
3915 3915
        }else{
3916 3916
            //ME/MC only
3917
            if(pict->pict_type == FF_I_TYPE){
3917
            if(pict->pict_type == AV_PICTURE_TYPE_I){
3918 3918
                for(y=0; y<h; y++){
3919 3919
                    for(x=0; x<w; x++){
3920 3920
                        s->current_picture.data[plane_index][y*s->current_picture.linesize[plane_index] + x]=

Also available in: Unified diff