Mercurial > libavcodec.hg
comparison mpegvideo.c @ 9643:5c9d3a72aabf libavcodec
change pic type to Picture* and remove casts
author | bcoudurier |
---|---|
date | Fri, 15 May 2009 02:01:53 +0000 |
parents | 0d6c8c99382e |
children | 15660ad4c641 |
comparison
equal
deleted
inserted
replaced
9642:d706b300b89f | 9643:5c9d3a72aabf |
---|---|
867 * generic function for encode/decode called after coding/decoding the header and before a frame is coded/decoded | 867 * generic function for encode/decode called after coding/decoding the header and before a frame is coded/decoded |
868 */ | 868 */ |
869 int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) | 869 int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) |
870 { | 870 { |
871 int i; | 871 int i; |
872 AVFrame *pic; | 872 Picture *pic; |
873 s->mb_skipped = 0; | 873 s->mb_skipped = 0; |
874 | 874 |
875 assert(s->last_picture_ptr==NULL || s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3); | 875 assert(s->last_picture_ptr==NULL || s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3); |
876 | 876 |
877 /* mark&release old frames */ | 877 /* mark&release old frames */ |
899 free_frame_buffer(s, &s->picture[i]); | 899 free_frame_buffer(s, &s->picture[i]); |
900 } | 900 } |
901 } | 901 } |
902 | 902 |
903 if(s->current_picture_ptr && s->current_picture_ptr->data[0]==NULL) | 903 if(s->current_picture_ptr && s->current_picture_ptr->data[0]==NULL) |
904 pic= (AVFrame*)s->current_picture_ptr; //we already have a unused image (maybe it was set before reading the header) | 904 pic= s->current_picture_ptr; //we already have a unused image (maybe it was set before reading the header) |
905 else{ | 905 else{ |
906 i= ff_find_unused_picture(s, 0); | 906 i= ff_find_unused_picture(s, 0); |
907 pic= (AVFrame*)&s->picture[i]; | 907 pic= &s->picture[i]; |
908 } | 908 } |
909 | 909 |
910 pic->reference= 0; | 910 pic->reference= 0; |
911 if (!s->dropable){ | 911 if (!s->dropable){ |
912 if (s->codec_id == CODEC_ID_H264) | 912 if (s->codec_id == CODEC_ID_H264) |
915 pic->reference = 3; | 915 pic->reference = 3; |
916 } | 916 } |
917 | 917 |
918 pic->coded_picture_number= s->coded_picture_number++; | 918 pic->coded_picture_number= s->coded_picture_number++; |
919 | 919 |
920 if( alloc_picture(s, (Picture*)pic, 0) < 0) | 920 if(alloc_picture(s, pic, 0) < 0) |
921 return -1; | 921 return -1; |
922 | 922 |
923 s->current_picture_ptr= (Picture*)pic; | 923 s->current_picture_ptr= pic; |
924 s->current_picture_ptr->top_field_first= s->top_field_first; //FIXME use only the vars from current_pic | 924 s->current_picture_ptr->top_field_first= s->top_field_first; //FIXME use only the vars from current_pic |
925 s->current_picture_ptr->interlaced_frame= !s->progressive_frame && !s->progressive_sequence; | 925 s->current_picture_ptr->interlaced_frame= !s->progressive_frame && !s->progressive_sequence; |
926 } | 926 } |
927 | 927 |
928 s->current_picture_ptr->pict_type= s->pict_type; | 928 s->current_picture_ptr->pict_type= s->pict_type; |