comparison ffv1.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
352 update_vlc_state(state, v); 352 update_vlc_state(state, v);
353 //printf("final: %d\n", ret); 353 //printf("final: %d\n", ret);
354 return ret; 354 return ret;
355 } 355 }
356 356
357 #ifdef CONFIG_ENCODERS
357 static inline int encode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){ 358 static inline int encode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){
358 PlaneContext * const p= &s->plane[plane_index]; 359 PlaneContext * const p= &s->plane[plane_index];
359 RangeCoder * const c= &s->c; 360 RangeCoder * const c= &s->c;
360 int x; 361 int x;
361 int run_index= s->run_index; 362 int run_index= s->run_index;
525 put_rac(c, state, 0); //no transparency plane 526 put_rac(c, state, 0); //no transparency plane
526 527
527 for(i=0; i<5; i++) 528 for(i=0; i<5; i++)
528 write_quant_table(c, f->quant_table[i]); 529 write_quant_table(c, f->quant_table[i]);
529 } 530 }
531 #endif /* CONFIG_ENCODERS */
530 532
531 static int common_init(AVCodecContext *avctx){ 533 static int common_init(AVCodecContext *avctx){
532 FFV1Context *s = avctx->priv_data; 534 FFV1Context *s = avctx->priv_data;
533 int width, height; 535 int width, height;
534 536
543 assert(width && height); 545 assert(width && height);
544 546
545 return 0; 547 return 0;
546 } 548 }
547 549
550 #ifdef CONFIG_ENCODERS
548 static int encode_init(AVCodecContext *avctx) 551 static int encode_init(AVCodecContext *avctx)
549 { 552 {
550 FFV1Context *s = avctx->priv_data; 553 FFV1Context *s = avctx->priv_data;
551 int i; 554 int i;
552 555
606 609
607 s->picture_number=0; 610 s->picture_number=0;
608 611
609 return 0; 612 return 0;
610 } 613 }
614 #endif /* CONFIG_ENCODERS */
611 615
612 616
613 static void clear_state(FFV1Context *f){ 617 static void clear_state(FFV1Context *f){
614 int i, j; 618 int i, j;
615 619
630 } 634 }
631 } 635 }
632 } 636 }
633 } 637 }
634 638
639 #ifdef CONFIG_ENCODERS
635 static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){ 640 static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
636 FFV1Context *f = avctx->priv_data; 641 FFV1Context *f = avctx->priv_data;
637 RangeCoder * const c= &f->c; 642 RangeCoder * const c= &f->c;
638 AVFrame *pict = data; 643 AVFrame *pict = data;
639 const int width= f->width; 644 const int width= f->width;
685 }else{ 690 }else{
686 flush_put_bits(&f->pb); //nicer padding FIXME 691 flush_put_bits(&f->pb); //nicer padding FIXME
687 return used_count + (put_bits_count(&f->pb)+7)/8; 692 return used_count + (put_bits_count(&f->pb)+7)/8;
688 } 693 }
689 } 694 }
695 #endif /* CONFIG_ENCODERS */
690 696
691 static int common_end(AVCodecContext *avctx){ 697 static int common_end(AVCodecContext *avctx){
692 FFV1Context *s = avctx->priv_data; 698 FFV1Context *s = avctx->priv_data;
693 int i; 699 int i;
694 700