~ppsspp/ppsspp/ffmpeg

« back to all changes in this revision

Viewing changes to libavcodec/mss2.c

  • Committer: Henrik Rydgård
  • Date: 2014-01-03 10:44:32 UTC
  • Revision ID: git-v1:87c6c126784b1718bfa448ecf2e6a9fef781eb4e
Update our ffmpeg snapshot to a clone of the official repository.

This is because Maxim's at3plus support has been officially merged!

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
    }
55
55
}
56
56
 
57
 
ARITH_GET_BIT(2)
 
57
ARITH_GET_BIT(arith2)
58
58
 
59
59
/* L. Stuiver and A. Moffat: "Piecewise Integer Mapping for Arithmetic Coding."
60
60
 * In Proc. 8th Data Compression Conference (DCC '98), pp. 3-12, Mar. 1998 */
127
127
    return i;
128
128
}
129
129
 
130
 
ARITH_GET_MODEL_SYM(2)
 
130
ARITH_GET_MODEL_SYM(arith2)
131
131
 
132
132
static int arith2_get_consumed_bytes(ArithCoder *c)
133
133
{
377
377
 
378
378
    ff_mpeg_flush(avctx);
379
379
 
380
 
    if (s->current_picture_ptr == NULL || s->current_picture_ptr->f.data[0]) {
381
 
        int i = ff_find_unused_picture(s, 0);
382
 
        if (i < 0)
383
 
            return i;
384
 
        s->current_picture_ptr = &s->picture[i];
385
 
    }
386
 
 
387
 
    init_get_bits(&s->gb, buf, buf_size * 8);
 
380
    if ((ret = init_get_bits8(&s->gb, buf, buf_size)) < 0)
 
381
        return ret;
388
382
 
389
383
    s->loop_filter = avctx->skip_loop_filter < AVDISCARD_ALL;
390
384
 
482
476
    av_assert0(FF_INPUT_BUFFER_PADDING_SIZE >=
483
477
               ARITH2_PADDING + (MIN_CACHE_BITS + 7) / 8);
484
478
 
485
 
    init_get_bits(&gb, buf, buf_size * 8);
 
479
    if ((ret = init_get_bits8(&gb, buf, buf_size)) < 0)
 
480
        return ret;
486
481
 
487
482
    if (keyframe = get_bits1(&gb))
488
483
        skip_bits(&gb, 7);
640
635
                ff_mss12_slicecontext_reset(&ctx->sc[1]);
641
636
        }
642
637
        if (is_rle) {
643
 
            init_get_bits(&gb, buf, buf_size * 8);
 
638
            if ((ret = init_get_bits8(&gb, buf, buf_size)) < 0)
 
639
                return ret;
644
640
            if (ret = decode_rle(&gb, c->pal_pic, c->pal_stride,
645
641
                                 c->rgb_pic, c->rgb_stride, c->pal, keyframe,
646
642
                                 ctx->split_position, 0,
775
771
 
776
772
    v->overlap         = 0;
777
773
 
778
 
    v->s.resync_marker = 0;
 
774
    v->resync_marker   = 0;
779
775
    v->rangered        = 0;
780
776
 
781
777
    v->s.max_b_frames = avctx->max_b_frames = 0;
837
833
    avctx->pix_fmt = c->free_colours == 127 ? AV_PIX_FMT_RGB555
838
834
                                            : AV_PIX_FMT_RGB24;
839
835
 
 
836
 
840
837
    return 0;
841
838
}
842
839