Mercurial > libavcodec.hg
comparison asv1.c @ 3777:20545fbb6f7c libavcodec
add some #ifdef CONFIG_ENCODERS/DECODERS
author | mru |
---|---|
date | Wed, 27 Sep 2006 19:54:07 +0000 |
parents | 0082fb8c77b6 |
children | c8c591fe26f8 |
comparison
equal
deleted
inserted
replaced
3776:1843a85123b7 | 3777:20545fbb6f7c |
---|---|
460 emms_c(); | 460 emms_c(); |
461 | 461 |
462 return (get_bits_count(&a->gb)+31)/32*4; | 462 return (get_bits_count(&a->gb)+31)/32*4; |
463 } | 463 } |
464 | 464 |
465 #ifdef CONFIG_ENCODERS | |
465 static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){ | 466 static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){ |
466 ASV1Context * const a = avctx->priv_data; | 467 ASV1Context * const a = avctx->priv_data; |
467 AVFrame *pict = data; | 468 AVFrame *pict = data; |
468 AVFrame * const p= (AVFrame*)&a->picture; | 469 AVFrame * const p= (AVFrame*)&a->picture; |
469 int size; | 470 int size; |
513 buf[i]= ff_reverse[ buf[i] ]; | 514 buf[i]= ff_reverse[ buf[i] ]; |
514 } | 515 } |
515 | 516 |
516 return size*4; | 517 return size*4; |
517 } | 518 } |
519 #endif /* CONFIG_ENCODERS */ | |
518 | 520 |
519 static void common_init(AVCodecContext *avctx){ | 521 static void common_init(AVCodecContext *avctx){ |
520 ASV1Context * const a = avctx->priv_data; | 522 ASV1Context * const a = avctx->priv_data; |
521 | 523 |
522 dsputil_init(&a->dsp, avctx); | 524 dsputil_init(&a->dsp, avctx); |
562 memset(p->qscale_table, p->quality, p->qstride*a->mb_height); | 564 memset(p->qscale_table, p->quality, p->qstride*a->mb_height); |
563 | 565 |
564 return 0; | 566 return 0; |
565 } | 567 } |
566 | 568 |
569 #ifdef CONFIG_ENCODERS | |
567 static int encode_init(AVCodecContext *avctx){ | 570 static int encode_init(AVCodecContext *avctx){ |
568 ASV1Context * const a = avctx->priv_data; | 571 ASV1Context * const a = avctx->priv_data; |
569 int i; | 572 int i; |
570 const int scale= avctx->codec_id == CODEC_ID_ASV1 ? 1 : 2; | 573 const int scale= avctx->codec_id == CODEC_ID_ASV1 ? 1 : 2; |
571 | 574 |
585 a->q_intra_matrix[i]= ((a->inv_qscale<<16) + q/2) / q; | 588 a->q_intra_matrix[i]= ((a->inv_qscale<<16) + q/2) / q; |
586 } | 589 } |
587 | 590 |
588 return 0; | 591 return 0; |
589 } | 592 } |
593 #endif | |
590 | 594 |
591 static int decode_end(AVCodecContext *avctx){ | 595 static int decode_end(AVCodecContext *avctx){ |
592 ASV1Context * const a = avctx->priv_data; | 596 ASV1Context * const a = avctx->priv_data; |
593 | 597 |
594 av_freep(&a->bitstream_buffer); | 598 av_freep(&a->bitstream_buffer); |