Mercurial > libavcodec.hg
changeset 4269:c37ea749711e libavcodec
Removing unused code
author | takis |
---|---|
date | Tue, 05 Dec 2006 22:05:09 +0000 |
parents | 3a4d4be05618 |
children | 758ba4a18478 |
files | h264.c |
diffstat | 1 files changed, 0 insertions(+), 75 deletions(-) [+] |
line wrap: on
line diff
--- a/h264.c Tue Dec 05 21:57:31 2006 +0000 +++ b/h264.c Tue Dec 05 22:05:09 2006 +0000 @@ -1794,81 +1794,6 @@ return dst; } -#if 0 -/** - * @param src the data which should be escaped - * @param dst the target buffer, dst+1 == src is allowed as a special case - * @param length the length of the src data - * @param dst_length the length of the dst array - * @returns length of escaped data in bytes or -1 if an error occured - */ -static int encode_nal(H264Context *h, uint8_t *dst, uint8_t *src, int length, int dst_length){ - int i, escape_count, si, di; - uint8_t *temp; - - assert(length>=0); - assert(dst_length>0); - - dst[0]= (h->nal_ref_idc<<5) + h->nal_unit_type; - - if(length==0) return 1; - - escape_count= 0; - for(i=0; i<length; i+=2){ - if(src[i]) continue; - if(i>0 && src[i-1]==0) - i--; - if(i+2<length && src[i+1]==0 && src[i+2]<=3){ - escape_count++; - i+=2; - } - } - - if(escape_count==0){ - if(dst+1 != src) - memcpy(dst+1, src, length); - return length + 1; - } - - if(length + escape_count + 1> dst_length) - return -1; - - //this should be damn rare (hopefully) - - h->rbsp_buffer= av_fast_realloc(h->rbsp_buffer, &h->rbsp_buffer_size, length + escape_count); - temp= h->rbsp_buffer; -//printf("encoding esc\n"); - - si= 0; - di= 0; - while(si < length){ - if(si+2<length && src[si]==0 && src[si+1]==0 && src[si+2]<=3){ - temp[di++]= 0; si++; - temp[di++]= 0; si++; - temp[di++]= 3; - temp[di++]= src[si++]; - } - else - temp[di++]= src[si++]; - } - memcpy(dst+1, temp, length+escape_count); - - assert(di == length+escape_count); - - return di + 1; -} - -/** - * write 1,10,100,1000,... for alignment, yes its exactly inverse to mpeg4 - */ -static void encode_rbsp_trailing(PutBitContext *pb){ - int length; - put_bits(pb, 1, 1); - length= (-put_bits_count(pb))&7; - if(length) put_bits(pb, length, 0); -} -#endif - /** * identifies the exact end of the bitstream * @return the length of the trailing, or 0 if damaged