~ubuntu-branches/ubuntu/trusty/libav/trusty

« back to all changes in this revision

Viewing changes to libavcodec/snow.c

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler, Jonathan Nieder, Reinhard Tartler
  • Date: 2011-05-13 12:31:33 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (1.3.4 sid)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20110513123133-zqcsj91sf5489y4s
Tags: 4:0.7~beta2-1
[ Jonathan Nieder ]
* only install doc/APIChanges in *-dev and libav-doc packages
* move note on source package lineage to README.Debian
* install NEWS.Debian in libavcodec-dev
* use dpkg source format 3.0 (quilt)
* allow "debian/rules clean" as unprivileged user

[ Reinhard Tartler ]
* New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
2080
2080
    ff_init_range_decoder(c, buf, buf_size);
2081
2081
    ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
2082
2082
 
2083
 
    s->current_picture.pict_type= FF_I_TYPE; //FIXME I vs. P
 
2083
    s->current_picture.pict_type= AV_PICTURE_TYPE_I; //FIXME I vs. P
2084
2084
    if(decode_header(s)<0)
2085
2085
        return -1;
2086
2086
    common_init_after_header(avctx);
3299
3299
                }
3300
3300
                best_rd= ref_rd;
3301
3301
                *block= ref_b;
3302
 
#if 1
3303
3302
                check_block(s, mb_x, mb_y, color, 1, *obmc_edged, &best_rd);
3304
3303
                //FIXME RD style color selection
3305
 
#endif
3306
3304
                if(!same_block(block, &backup)){
3307
3305
                    if(tb ) tb ->type &= ~BLOCK_OPT;
3308
3306
                    if(lb ) lb ->type &= ~BLOCK_OPT;
3659
3657
    coef_sum = (uint64_t)coef_sum * coef_sum >> 16;
3660
3658
    assert(coef_sum < INT_MAX);
3661
3659
 
3662
 
    if(pict->pict_type == FF_I_TYPE){
 
3660
    if(pict->pict_type == AV_PICTURE_TYPE_I){
3663
3661
        s->m.current_picture.mb_var_sum= coef_sum;
3664
3662
        s->m.current_picture.mc_mb_var_sum= 0;
3665
3663
    }else{
3728
3726
    if(avctx->flags&CODEC_FLAG_PASS2){
3729
3727
        s->m.pict_type =
3730
3728
        pict->pict_type= s->m.rc_context.entry[avctx->frame_number].new_pict_type;
3731
 
        s->keyframe= pict->pict_type==FF_I_TYPE;
 
3729
        s->keyframe= pict->pict_type==AV_PICTURE_TYPE_I;
3732
3730
        if(!(avctx->flags&CODEC_FLAG_QSCALE)) {
3733
3731
            pict->quality= ff_rate_estimate_qscale(&s->m, 0);
3734
3732
            if (pict->quality < 0)
3737
3735
    }else{
3738
3736
        s->keyframe= avctx->gop_size==0 || avctx->frame_number % avctx->gop_size == 0;
3739
3737
        s->m.pict_type=
3740
 
        pict->pict_type= s->keyframe ? FF_I_TYPE : FF_P_TYPE;
 
3738
        pict->pict_type= s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
3741
3739
    }
3742
3740
 
3743
3741
    if(s->pass1_rc && avctx->frame_number == 0)
3756
3754
    s->m.current_picture_ptr= &s->m.current_picture;
3757
3755
    s->m.last_picture.pts= s->m.current_picture.pts;
3758
3756
    s->m.current_picture.pts= pict->pts;
3759
 
    if(pict->pict_type == FF_P_TYPE){
 
3757
    if(pict->pict_type == AV_PICTURE_TYPE_P){
3760
3758
        int block_width = (width +15)>>4;
3761
3759
        int block_height= (height+15)>>4;
3762
3760
        int stride= s->current_picture.linesize[0];
3805
3803
 
3806
3804
redo_frame:
3807
3805
 
3808
 
    if(pict->pict_type == FF_I_TYPE)
 
3806
    if(pict->pict_type == AV_PICTURE_TYPE_I)
3809
3807
        s->spatial_decomposition_count= 5;
3810
3808
    else
3811
3809
        s->spatial_decomposition_count= 5;
3812
3810
 
3813
3811
    s->m.pict_type = pict->pict_type;
3814
 
    s->qbias= pict->pict_type == FF_P_TYPE ? 2 : 0;
 
3812
    s->qbias= pict->pict_type == AV_PICTURE_TYPE_P ? 2 : 0;
3815
3813
 
3816
3814
    common_init_after_header(avctx);
3817
3815
 
3844
3842
            predict_plane(s, s->spatial_idwt_buffer, plane_index, 0);
3845
3843
 
3846
3844
            if(   plane_index==0
3847
 
               && pict->pict_type == FF_P_TYPE
 
3845
               && pict->pict_type == AV_PICTURE_TYPE_P
3848
3846
               && !(avctx->flags&CODEC_FLAG_PASS2)
3849
3847
               && s->m.me.scene_change_score > s->avctx->scenechange_threshold){
3850
3848
                ff_init_range_encoder(c, buf, buf_size);
3851
3849
                ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
3852
 
                pict->pict_type= FF_I_TYPE;
 
3850
                pict->pict_type= AV_PICTURE_TYPE_I;
3853
3851
                s->keyframe=1;
3854
3852
                s->current_picture.key_frame=1;
3855
3853
                goto redo_frame;
3895
3893
                    if(!QUANTIZE2)
3896
3894
                        quantize(s, b, b->ibuf, b->buf, b->stride, s->qbias);
3897
3895
                    if(orientation==0)
3898
 
                        decorrelate(s, b, b->ibuf, b->stride, pict->pict_type == FF_P_TYPE, 0);
 
3896
                        decorrelate(s, b, b->ibuf, b->stride, pict->pict_type == AV_PICTURE_TYPE_P, 0);
3899
3897
                    encode_subband(s, b, b->ibuf, b->parent ? b->parent->ibuf : NULL, b->stride, orientation);
3900
3898
                    assert(b->parent==NULL || b->parent->stride == b->stride*2);
3901
3899
                    if(orientation==0)
3922
3920
            predict_plane(s, s->spatial_idwt_buffer, plane_index, 1);
3923
3921
        }else{
3924
3922
            //ME/MC only
3925
 
            if(pict->pict_type == FF_I_TYPE){
 
3923
            if(pict->pict_type == AV_PICTURE_TYPE_I){
3926
3924
                for(y=0; y<h; y++){
3927
3925
                    for(x=0; x<w; x++){
3928
3926
                        s->current_picture.data[plane_index][y*s->current_picture.linesize[plane_index] + x]=