Mercurial > libavcodec.hg
comparison mpegvideo.c @ 1026:d6ba0641cc36 libavcodec
cleanup
author | michaelni |
---|---|
date | Tue, 21 Jan 2003 21:30:48 +0000 |
parents | 2d7c9f5738de |
children | a78f6f72d54e |
comparison
equal
deleted
inserted
replaced
1025:1f9afd8b9131 | 1026:d6ba0641cc36 |
---|---|
2625 assert(0); | 2625 assert(0); |
2626 } | 2626 } |
2627 #endif | 2627 #endif |
2628 } | 2628 } |
2629 | 2629 |
2630 /** | |
2631 * combines the (truncated) bitstream to a complete frame | |
2632 * @returns -1 if no complete frame could be created | |
2633 */ | |
2634 int ff_combine_frame( MpegEncContext *s, int next, uint8_t **buf, int *buf_size){ | |
2635 ParseContext *pc= &s->parse_context; | |
2636 | |
2637 pc->last_index= pc->index; | |
2638 | |
2639 if(next==-1){ | |
2640 pc->buffer= av_fast_realloc(pc->buffer, &pc->buffer_size, (*buf_size) + pc->index + FF_INPUT_BUFFER_PADDING_SIZE); | |
2641 | |
2642 memcpy(&pc->buffer[pc->index], *buf, *buf_size); | |
2643 pc->index += *buf_size; | |
2644 return -1; | |
2645 } | |
2646 | |
2647 if(pc->index){ | |
2648 pc->buffer= av_fast_realloc(pc->buffer, &pc->buffer_size, next + pc->index + FF_INPUT_BUFFER_PADDING_SIZE); | |
2649 | |
2650 memcpy(&pc->buffer[pc->index], *buf, next + FF_INPUT_BUFFER_PADDING_SIZE ); | |
2651 pc->index = 0; | |
2652 *buf= pc->buffer; | |
2653 *buf_size= pc->last_index + next; | |
2654 } | |
2655 | |
2656 return 0; | |
2657 } | |
2658 | |
2630 void ff_copy_bits(PutBitContext *pb, UINT8 *src, int length) | 2659 void ff_copy_bits(PutBitContext *pb, UINT8 *src, int length) |
2631 { | 2660 { |
2632 int bytes= length>>4; | 2661 int bytes= length>>4; |
2633 int bits= length&15; | 2662 int bits= length&15; |
2634 int i; | 2663 int i; |