comparison mpegvideo.c @ 1552:26c6ecba99a1 libavcodec

dynamic alloc of picture structs instead of putting them in MpegEncContext
author michael
date Tue, 21 Oct 2003 19:55:31 +0000
parents 5d06823e2ee9
children 541681146f83
comparison
equal deleted inserted replaced
1551:85028cd13cf1 1552:26c6ecba99a1
442 CHECKED_ALLOCZ(s->mb_type , mb_array_size * sizeof(uint8_t)) //needed for encoding 442 CHECKED_ALLOCZ(s->mb_type , mb_array_size * sizeof(uint8_t)) //needed for encoding
443 443
444 CHECKED_ALLOCZ(s->lambda_table, mb_array_size * sizeof(int)) 444 CHECKED_ALLOCZ(s->lambda_table, mb_array_size * sizeof(int))
445 } 445 }
446 446
447 CHECKED_ALLOCZ(s->picture, MAX_PICTURE_COUNT * sizeof(Picture))
448
447 CHECKED_ALLOCZ(s->error_status_table, mb_array_size*sizeof(uint8_t)) 449 CHECKED_ALLOCZ(s->error_status_table, mb_array_size*sizeof(uint8_t))
448 450
449 if (s->out_format == FMT_H263 || s->encoding) { 451 if (s->out_format == FMT_H263 || s->encoding) {
450 int size; 452 int size;
451 453
560 av_freep(&s->lambda_table); 562 av_freep(&s->lambda_table);
561 563
562 for(i=0; i<MAX_PICTURE_COUNT; i++){ 564 for(i=0; i<MAX_PICTURE_COUNT; i++){
563 free_picture(s, &s->picture[i]); 565 free_picture(s, &s->picture[i]);
564 } 566 }
567 av_freep(&s->picture);
565 avcodec_default_free_buffers(s->avctx); 568 avcodec_default_free_buffers(s->avctx);
566 s->context_initialized = 0; 569 s->context_initialized = 0;
567 s->last_picture_ptr= 570 s->last_picture_ptr=
568 s->next_picture_ptr= 571 s->next_picture_ptr=
569 s->current_picture_ptr= NULL; 572 s->current_picture_ptr= NULL;