~ubuntu-branches/debian/experimental/libav/experimental

« back to all changes in this revision

Viewing changes to libavcodec/rv10.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2014-08-17 22:33:40 UTC
  • mfrom: (1.1.30)
  • Revision ID: package-import@ubuntu.com-20140817223340-net3rzywma60pzhz
Tags: 6:11~beta1-1
* New upstream Release v11~alpha2
* build against libgnutls28-dev (Closes: #758447)
* Bump shlibs

Show diffs side-by-side

added added

removed removed

Lines of Context:
326
326
        return AVERROR_INVALIDDATA;
327
327
    }
328
328
 
329
 
    if (s->last_picture_ptr == NULL && s->pict_type == AV_PICTURE_TYPE_B) {
 
329
    if (!s->last_picture_ptr && s->pict_type == AV_PICTURE_TYPE_B) {
330
330
        av_log(s->avctx, AV_LOG_ERROR, "early B-frame\n");
331
331
        return AVERROR_INVALIDDATA;
332
332
    }
372
372
        if (new_w != s->width || new_h != s->height) {
373
373
            av_log(s->avctx, AV_LOG_DEBUG,
374
374
                   "attempting to change resolution to %dx%d\n", new_w, new_h);
375
 
            ff_MPV_common_end(s);
 
375
            ff_mpv_common_end(s);
376
376
 
377
377
            ret = ff_set_dimensions(s->avctx, new_w, new_h);
378
378
            if (ret < 0)
380
380
 
381
381
            s->width  = new_w;
382
382
            s->height = new_h;
383
 
            if ((ret = ff_MPV_common_init(s)) < 0)
 
383
            if ((ret = ff_mpv_common_init(s)) < 0)
384
384
                return ret;
385
385
        }
386
386
 
455
455
                                   avctx->coded_height, 0, avctx)) < 0)
456
456
        return ret;
457
457
 
458
 
    ff_MPV_decode_defaults(s);
 
458
    ff_mpv_decode_defaults(s);
459
459
 
460
460
    s->avctx       = avctx;
461
461
    s->out_format  = FMT_H263;
498
498
 
499
499
    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
500
500
 
501
 
    if ((ret = ff_MPV_common_init(s)) < 0)
 
501
    ff_mpv_idct_init(s);
 
502
    if ((ret = ff_mpv_common_init(s)) < 0)
502
503
        return ret;
503
504
 
504
505
    ff_h263dsp_init(&s->h263dsp);
522
523
{
523
524
    MpegEncContext *s = avctx->priv_data;
524
525
 
525
 
    ff_MPV_common_end(s);
 
526
    ff_mpv_common_end(s);
526
527
    return 0;
527
528
}
528
529
 
556
557
        return AVERROR_INVALIDDATA;
557
558
    }
558
559
 
559
 
    if ((s->mb_x == 0 && s->mb_y == 0) || s->current_picture_ptr == NULL) {
 
560
    if ((s->mb_x == 0 && s->mb_y == 0) || !s->current_picture_ptr) {
560
561
        // FIXME write parser so we always have complete frames?
561
562
        if (s->current_picture_ptr) {
562
563
            ff_er_frame_end(&s->er);
563
 
            ff_MPV_frame_end(s);
 
564
            ff_mpv_frame_end(s);
564
565
            s->mb_x = s->mb_y = s->resync_mb_x = s->resync_mb_y = 0;
565
566
        }
566
 
        if ((ret = ff_MPV_frame_start(s, avctx)) < 0)
 
567
        if ((ret = ff_mpv_frame_start(s, avctx)) < 0)
567
568
            return ret;
568
569
        ff_mpeg_er_frame_start(s);
569
570
    } else {
645
646
        }
646
647
        if (s->pict_type != AV_PICTURE_TYPE_B)
647
648
            ff_h263_update_motion_val(s);
648
 
        ff_MPV_decode_mb(s, s->block);
 
649
        ff_mpv_decode_mb(s, s->block);
649
650
        if (s->loop_filter)
650
651
            ff_h263_loop_filter(s);
651
652
 
736
737
            i++;
737
738
    }
738
739
 
739
 
    if (s->current_picture_ptr != NULL && s->mb_y >= s->mb_height) {
 
740
    if (s->current_picture_ptr && s->mb_y >= s->mb_height) {
740
741
        ff_er_frame_end(&s->er);
741
 
        ff_MPV_frame_end(s);
 
742
        ff_mpv_frame_end(s);
742
743
 
743
744
        if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
744
745
            if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0)
745
746
                return ret;
746
747
            ff_print_debug_info(s, s->current_picture_ptr);
747
 
        } else if (s->last_picture_ptr != NULL) {
 
748
        } else if (s->last_picture_ptr) {
748
749
            if ((ret = av_frame_ref(pict, s->last_picture_ptr->f)) < 0)
749
750
                return ret;
750
751
            ff_print_debug_info(s, s->last_picture_ptr);