comparison mpegvideo.c @ 1944:a3f44c9168aa libavcodec

flv dropable p frame support
author michael
date Sat, 17 Apr 2004 13:36:21 +0000
parents e2501e6e7ff7
children 32f68745c431
comparison
equal deleted inserted replaced
1943:62beeb1a8676 1944:a3f44c9168aa
1336 s->mb_skiped = 0; 1336 s->mb_skiped = 0;
1337 1337
1338 assert(s->last_picture_ptr==NULL || s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3); 1338 assert(s->last_picture_ptr==NULL || s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3);
1339 1339
1340 /* mark&release old frames */ 1340 /* mark&release old frames */
1341 if (s->pict_type != B_TYPE && s->last_picture_ptr && s->last_picture_ptr->data[0]) { 1341 if (s->pict_type != B_TYPE && s->last_picture_ptr && s->last_picture_ptr != s->next_picture_ptr && s->last_picture_ptr->data[0]) {
1342 avctx->release_buffer(avctx, (AVFrame*)s->last_picture_ptr); 1342 avctx->release_buffer(avctx, (AVFrame*)s->last_picture_ptr);
1343 1343
1344 /* release forgotten pictures */ 1344 /* release forgotten pictures */
1345 /* if(mpeg124/h263) */ 1345 /* if(mpeg124/h263) */
1346 if(!s->encoding){ 1346 if(!s->encoding){
1366 else{ 1366 else{
1367 i= ff_find_unused_picture(s, 0); 1367 i= ff_find_unused_picture(s, 0);
1368 pic= (AVFrame*)&s->picture[i]; 1368 pic= (AVFrame*)&s->picture[i];
1369 } 1369 }
1370 1370
1371 pic->reference= s->pict_type != B_TYPE ? 3 : 0; 1371 pic->reference= s->pict_type != B_TYPE && !s->dropable ? 3 : 0;
1372 1372
1373 pic->coded_picture_number= s->coded_picture_number++; 1373 pic->coded_picture_number= s->coded_picture_number++;
1374 1374
1375 if( alloc_picture(s, (Picture*)pic, 0) < 0) 1375 if( alloc_picture(s, (Picture*)pic, 0) < 0)
1376 return -1; 1376 return -1;
1388 copy_picture(&s->current_picture, s->current_picture_ptr); 1388 copy_picture(&s->current_picture, s->current_picture_ptr);
1389 1389
1390 if(s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3){ 1390 if(s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3){
1391 if (s->pict_type != B_TYPE) { 1391 if (s->pict_type != B_TYPE) {
1392 s->last_picture_ptr= s->next_picture_ptr; 1392 s->last_picture_ptr= s->next_picture_ptr;
1393 s->next_picture_ptr= s->current_picture_ptr; 1393 if(!s->dropable)
1394 } 1394 s->next_picture_ptr= s->current_picture_ptr;
1395 }
1396 /* av_log(s->avctx, AV_LOG_DEBUG, "L%p N%p C%p L%p N%p C%p type:%d drop:%d\n", s->last_picture_ptr, s->next_picture_ptr,s->current_picture_ptr,
1397 s->last_picture_ptr ? s->last_picture_ptr->data[0] : NULL,
1398 s->next_picture_ptr ? s->next_picture_ptr->data[0] : NULL,
1399 s->current_picture_ptr ? s->current_picture_ptr->data[0] : NULL,
1400 s->pict_type, s->dropable);*/
1395 1401
1396 if(s->last_picture_ptr) copy_picture(&s->last_picture, s->last_picture_ptr); 1402 if(s->last_picture_ptr) copy_picture(&s->last_picture, s->last_picture_ptr);
1397 if(s->next_picture_ptr) copy_picture(&s->next_picture, s->next_picture_ptr); 1403 if(s->next_picture_ptr) copy_picture(&s->next_picture, s->next_picture_ptr);
1398 1404
1399 if(s->pict_type != I_TYPE && (s->last_picture_ptr==NULL || s->last_picture_ptr->data[0]==NULL)){ 1405 if(s->pict_type != I_TYPE && (s->last_picture_ptr==NULL || s->last_picture_ptr->data[0]==NULL)){