Mercurial > libavcodec.hg
comparison h264.c @ 2416:06b7d678b582 libavcodec
10l: scratchpad could be allocated before its size was known.
author | lorenm |
---|---|
date | Sat, 08 Jan 2005 08:56:18 +0000 |
parents | db2cf6005d19 |
children | 991f39305057 |
comparison
equal
deleted
inserted
replaced
2415:db2cf6005d19 | 2416:06b7d678b582 |
---|---|
2538 h->mb2b_xy [mb_xy]= b_xy; | 2538 h->mb2b_xy [mb_xy]= b_xy; |
2539 h->mb2b8_xy[mb_xy]= b8_xy; | 2539 h->mb2b8_xy[mb_xy]= b8_xy; |
2540 } | 2540 } |
2541 } | 2541 } |
2542 | 2542 |
2543 CHECKED_ALLOCZ(s->obmc_scratchpad, 16*s->linesize + 2*8*s->uvlinesize); | |
2544 | |
2545 return 0; | 2543 return 0; |
2546 fail: | 2544 fail: |
2547 free_tables(h); | 2545 free_tables(h); |
2548 return -1; | 2546 return -1; |
2549 } | 2547 } |
2610 } | 2608 } |
2611 for(i=0; i<4; i++){ | 2609 for(i=0; i<4; i++){ |
2612 h->block_offset[16+i]= | 2610 h->block_offset[16+i]= |
2613 h->block_offset[20+i]= 4*((scan8[i] - scan8[0])&7) + 4*s->uvlinesize*((scan8[i] - scan8[0])>>3); | 2611 h->block_offset[20+i]= 4*((scan8[i] - scan8[0])&7) + 4*s->uvlinesize*((scan8[i] - scan8[0])>>3); |
2614 } | 2612 } |
2613 | |
2614 /* can't be in alloc_tables because linesize isn't known there. | |
2615 * FIXME: redo bipred weight to not require extra buffer? */ | |
2616 if(!s->obmc_scratchpad) | |
2617 s->obmc_scratchpad = av_malloc(16*s->linesize + 2*8*s->uvlinesize); | |
2615 | 2618 |
2616 // s->decode= (s->flags&CODEC_FLAG_PSNR) || !s->encoding || s->current_picture.reference /*|| h->contains_intra*/ || 1; | 2619 // s->decode= (s->flags&CODEC_FLAG_PSNR) || !s->encoding || s->current_picture.reference /*|| h->contains_intra*/ || 1; |
2617 } | 2620 } |
2618 | 2621 |
2619 static inline void backup_mb_border(H264Context *h, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, int linesize, int uvlinesize){ | 2622 static inline void backup_mb_border(H264Context *h, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, int linesize, int uvlinesize){ |