~ubuntu-branches/ubuntu/raring/gst-libav1.0/raring

« back to all changes in this revision

Viewing changes to gst-libs/ext/libav/libavcodec/h264.c

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2013-03-22 18:30:16 UTC
  • mfrom: (13.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130322183016-j9g41he8zscizfsj
Tags: 1.0.6-1
New upstream bugfix release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2866
2866
    h->mb_mbaff = 0;
2867
2867
    h->mb_aff_frame = 0;
2868
2868
    last_pic_structure = s0->picture_structure;
2869
 
    last_pic_dropable  = s->dropable;
 
2869
    last_pic_dropable  = s0->dropable;
2870
2870
    s->dropable        = h->nal_ref_idc == 0;
2871
2871
    if(h->sps.frame_mbs_only_flag){
2872
2872
        s->picture_structure= PICT_FRAME;
2889
2889
            s->picture_structure = last_pic_structure;
2890
2890
            s->dropable          = last_pic_dropable;
2891
2891
            return AVERROR_INVALIDDATA;
 
2892
        } else if (!s->current_picture_ptr) {
 
2893
            av_log(s->avctx, AV_LOG_ERROR,
 
2894
                   "unset current_picture_ptr on %d. slice\n",
 
2895
                   h0->current_slice + 1);
 
2896
            return AVERROR_INVALIDDATA;
2892
2897
        }
2893
2898
    } else {
2894
2899
        /* Shorten frame num gaps so we don't have to allocate reference
3116
3121
 
3117
3122
        if(num_ref_idx_active_override_flag){
3118
3123
            h->ref_count[0]= get_ue_golomb(&s->gb) + 1;
3119
 
            if(h->slice_type_nos==AV_PICTURE_TYPE_B)
 
3124
            if (h->ref_count[0] < 1)
 
3125
                return AVERROR_INVALIDDATA;
 
3126
            if (h->slice_type_nos == AV_PICTURE_TYPE_B) {
3120
3127
                h->ref_count[1]= get_ue_golomb(&s->gb) + 1;
 
3128
                if (h->ref_count[1] < 1)
 
3129
                    return AVERROR_INVALIDDATA;
 
3130
            }
3121
3131
        }
3122
3132
 
3123
3133
        if (h->ref_count[0] > max_refs || h->ref_count[1] > max_refs) {
3760
3770
                        ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, ER_MB_END&part_mask);
3761
3771
 
3762
3772
                        return 0;
3763
 
                    }else{
3764
 
                        ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, ER_MB_END&part_mask);
3765
 
 
 
3773
                    } else {
 
3774
                        ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y,
 
3775
                                        s->mb_x - 1, s->mb_y,
 
3776
                                        ER_MB_END & part_mask);
3766
3777
                        return -1;
3767
3778
                    }
3768
3779
                }
4007
4018
            hx->inter_gb_ptr= &hx->inter_gb;
4008
4019
 
4009
4020
            if(hx->redundant_pic_count==0 && hx->intra_gb_ptr && hx->s.data_partitioning
 
4021
               && s->current_picture_ptr
4010
4022
               && s->context_initialized
4011
4023
               && (avctx->skip_frame < AVDISCARD_NONREF || hx->nal_ref_idc)
4012
4024
               && (avctx->skip_frame < AVDISCARD_BIDIR  || hx->slice_type_nos!=AV_PICTURE_TYPE_B)
4029
4041
                ff_h264_decode_seq_parameter_set(h);
4030
4042
            }
4031
4043
 
4032
 
            if (s->flags& CODEC_FLAG_LOW_DELAY ||
4033
 
                (h->sps.bitstream_restriction_flag && !h->sps.num_reorder_frames))
4034
 
                s->low_delay=1;
 
4044
            if (s->flags & CODEC_FLAG_LOW_DELAY ||
 
4045
                (h->sps.bitstream_restriction_flag &&
 
4046
                 !h->sps.num_reorder_frames)) {
 
4047
                if (s->avctx->has_b_frames > 1 || h->delayed_pic[0])
 
4048
                    av_log(avctx, AV_LOG_WARNING, "Delayed frames seen "
 
4049
                           "reenabling low delay requires a codec "
 
4050
                           "flush.\n");
 
4051
                else
 
4052
                    s->low_delay = 1;
 
4053
            }
4035
4054
 
4036
4055
            if(avctx->has_b_frames < 2)
4037
4056
                avctx->has_b_frames= !s->low_delay;