comparison mpegvideo.c @ 3777:20545fbb6f7c libavcodec

add some #ifdef CONFIG_ENCODERS/DECODERS
author mru
date Wed, 27 Sep 2006 19:54:07 +0000
parents 1843a85123b7
children 6741c0e88310
comparison
equal deleted inserted replaced
3776:1843a85123b7 3777:20545fbb6f7c
324 static void copy_picture(Picture *dst, Picture *src){ 324 static void copy_picture(Picture *dst, Picture *src){
325 *dst = *src; 325 *dst = *src;
326 dst->type= FF_BUFFER_TYPE_COPY; 326 dst->type= FF_BUFFER_TYPE_COPY;
327 } 327 }
328 328
329 #ifdef CONFIG_ENCODERS
329 static void copy_picture_attributes(MpegEncContext *s, AVFrame *dst, AVFrame *src){ 330 static void copy_picture_attributes(MpegEncContext *s, AVFrame *dst, AVFrame *src){
330 int i; 331 int i;
331 332
332 dst->pict_type = src->pict_type; 333 dst->pict_type = src->pict_type;
333 dst->quality = src->quality; 334 dst->quality = src->quality;
362 memcpy(dst->ref_index[i], src->ref_index[i], s->b8_stride*2*s->mb_height*sizeof(int8_t)); 363 memcpy(dst->ref_index[i], src->ref_index[i], s->b8_stride*2*s->mb_height*sizeof(int8_t));
363 } 364 }
364 } 365 }
365 } 366 }
366 } 367 }
368 #endif
367 369
368 /** 370 /**
369 * allocates a Picture 371 * allocates a Picture
370 * The pixels are allocated/set by calling get_buffer() if shared=0 372 * The pixels are allocated/set by calling get_buffer() if shared=0
371 */ 373 */
563 dst->pblocks[i] = (short *)(&dst->block[i]); 565 dst->pblocks[i] = (short *)(&dst->block[i]);
564 } 566 }
565 //STOP_TIMER("update_duplicate_context") //about 10k cycles / 0.01 sec for 1000frames on 1ghz with 2 threads 567 //STOP_TIMER("update_duplicate_context") //about 10k cycles / 0.01 sec for 1000frames on 1ghz with 2 threads
566 } 568 }
567 569
570 #ifdef CONFIG_ENCODERS
568 static void update_duplicate_context_after_me(MpegEncContext *dst, MpegEncContext *src){ 571 static void update_duplicate_context_after_me(MpegEncContext *dst, MpegEncContext *src){
569 #define COPY(a) dst->a= src->a 572 #define COPY(a) dst->a= src->a
570 COPY(pict_type); 573 COPY(pict_type);
571 COPY(current_picture); 574 COPY(current_picture);
572 COPY(f_code); 575 COPY(f_code);
579 COPY(frame_pred_frame_dct); //FIXME don't set in encode_header 582 COPY(frame_pred_frame_dct); //FIXME don't set in encode_header
580 COPY(progressive_frame); //FIXME don't set in encode_header 583 COPY(progressive_frame); //FIXME don't set in encode_header
581 COPY(partitioned_frame); //FIXME don't set in encode_header 584 COPY(partitioned_frame); //FIXME don't set in encode_header
582 #undef COPY 585 #undef COPY
583 } 586 }
587 #endif
584 588
585 /** 589 /**
586 * sets the given MpegEncContext to common defaults (same for encoding and decoding). 590 * sets the given MpegEncContext to common defaults (same for encoding and decoding).
587 * the changed fields will not depend upon the prior state of the MpegEncContext. 591 * the changed fields will not depend upon the prior state of the MpegEncContext.
588 */ 592 */
5705 merge_context_after_encode(s, s->thread_context[i]); 5709 merge_context_after_encode(s, s->thread_context[i]);
5706 } 5710 }
5707 emms_c(); 5711 emms_c();
5708 } 5712 }
5709 5713
5710 #endif //CONFIG_ENCODERS
5711
5712 static void denoise_dct_c(MpegEncContext *s, DCTELEM *block){ 5714 static void denoise_dct_c(MpegEncContext *s, DCTELEM *block){
5713 const int intra= s->mb_intra; 5715 const int intra= s->mb_intra;
5714 int i; 5716 int i;
5715 5717
5716 s->dct_count[intra]++; 5718 s->dct_count[intra]++;
5730 } 5732 }
5731 block[i]= level; 5733 block[i]= level;
5732 } 5734 }
5733 } 5735 }
5734 } 5736 }
5735
5736 #ifdef CONFIG_ENCODERS
5737 5737
5738 static int dct_quantize_trellis_c(MpegEncContext *s, 5738 static int dct_quantize_trellis_c(MpegEncContext *s,
5739 DCTELEM *block, int n, 5739 DCTELEM *block, int n,
5740 int qscale, int *overflow){ 5740 int qscale, int *overflow){
5741 const int *qmat; 5741 const int *qmat;