~akirad/cinecutie/trunk

« back to all changes in this revision

Viewing changes to quicktime/ffmpeg/libavcodec/rv10.c

  • Committer: Paolo Rampino
  • Date: 2010-03-06 18:08:30 UTC
  • Revision ID: git-v1:9d525e02347cedf5c7cbe9ecbf5d50b83c26f5e4
Updated ffmpeg, now open also flv with aac codecs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * RV10 codec
3
 
 * Copyright (c) 2000,2001 Fabrice Bellard.
 
3
 * Copyright (c) 2000,2001 Fabrice Bellard
4
4
 * Copyright (c) 2002-2004 Michael Niedermayer
5
5
 *
6
6
 * This file is part of FFmpeg.
21
21
 */
22
22
 
23
23
/**
24
 
 * @file rv10.c
 
24
 * @file libavcodec/rv10.c
25
25
 * RV10 codec.
26
26
 */
27
27
 
229
229
    return -code;
230
230
}
231
231
 
232
 
#ifdef CONFIG_ENCODERS
233
232
 
 
233
#if CONFIG_RV10_ENCODER || CONFIG_RV20_ENCODER
234
234
/* write RV 1.0 compatible frame header */
235
235
void rv10_encode_picture_header(MpegEncContext *s, int picture_number)
236
236
{
250
250
        /* specific MPEG like DC coding not used */
251
251
    }
252
252
    /* if multiple packets per frame are sent, the position at which
253
 
       to display the macro blocks is coded here */
 
253
       to display the macroblocks is coded here */
254
254
    if(!full_frame){
255
255
        put_bits(&s->pb, 6, 0); /* mb_x */
256
256
        put_bits(&s->pb, 6, 0); /* mb_y */
265
265
    put_bits(&s->pb, 1, 0);     /* unknown bit */
266
266
    put_bits(&s->pb, 5, s->qscale);
267
267
 
268
 
    put_bits(&s->pb, 8, picture_number&0xFF); //FIXME wrong, but correct is not known
 
268
    put_sbits(&s->pb, 8, picture_number); //FIXME wrong, but correct is not known
269
269
    s->mb_x= s->mb_y= 0;
270
270
    ff_h263_encode_mba(s);
271
271
 
304
304
}
305
305
#endif
306
306
 
307
 
#endif //CONFIG_ENCODERS
 
307
#endif /* CONFIG_RV10_ENCODER || CONFIG_RV20_ENCODER */
308
308
 
309
309
/* read RV 1.0 compatible frame header */
310
310
static int rv10_decode_picture_header(MpegEncContext *s)
352
352
        }
353
353
    }
354
354
    /* if multiple packets per frame are sent, the position at which
355
 
       to display the macro blocks is coded here */
 
355
       to display the macroblocks is coded here */
356
356
 
357
357
    mb_xy= s->mb_x + s->mb_y*s->mb_width;
358
358
    if(show_bits(&s->gb, 12)==0 || (mb_xy && mb_xy < s->mb_num)){
527
527
    MpegEncContext *s = avctx->priv_data;
528
528
    static int done=0;
529
529
 
 
530
    if (avctx->extradata_size < 8) {
 
531
        av_log(avctx, AV_LOG_ERROR, "Extradata is too small.\n");
 
532
        return -1;
 
533
    }
 
534
 
530
535
    MPV_decode_defaults(s);
531
536
 
532
537
    s->avctx= avctx;
542
547
    if (avctx->sub_id == 0x10000000) {
543
548
        s->rv10_version= 0;
544
549
        s->low_delay=1;
 
550
    } else if (avctx->sub_id == 0x10001000) {
 
551
        s->rv10_version= 3;
 
552
        s->low_delay=1;
545
553
    } else if (avctx->sub_id == 0x10002000) {
546
554
        s->rv10_version= 3;
547
555
        s->low_delay=1;
785
793
    rv10_decode_end,
786
794
    rv10_decode_frame,
787
795
    CODEC_CAP_DR1,
788
 
    .long_name = "RealVideo 1.0",
 
796
    .long_name = NULL_IF_CONFIG_SMALL("RealVideo 1.0"),
 
797
    .pix_fmts= ff_pixfmt_list_420,
789
798
};
790
799
 
791
800
AVCodec rv20_decoder = {
799
808
    rv10_decode_frame,
800
809
    CODEC_CAP_DR1 | CODEC_CAP_DELAY,
801
810
    .flush= ff_mpeg_flush,
802
 
    .long_name = "RealVideo 2.0",
 
811
    .long_name = NULL_IF_CONFIG_SMALL("RealVideo 2.0"),
 
812
    .pix_fmts= ff_pixfmt_list_420,
803
813
};
804
814