You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
Removing unused code
Originally committed as revision 7228 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@@ -1794,81 +1794,6 @@ static uint8_t *decode_nal(H264Context *h, uint8_t *src, int *dst_length, int *c
|
|||||||
return dst;
|
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
|
* identifies the exact end of the bitstream
|
||||||
* @return the length of the trailing, or 0 if damaged
|
* @return the length of the trailing, or 0 if damaged
|
||||||
|
Reference in New Issue
Block a user