I noticed the following functions in Bitstream.c have these lines duplicated in their definitions.<br><br>Is this a typo or were these place intentionally?<br><br><blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
29 static uint8_t *x264_nal_escape_c( uint8_t *dst, uint8_t *src, uint8_t *end )<br> 30 {<br> 31 <b>if( src < end ) *dst++ = *src++;</b><br> 32 <b>if( src < end ) *dst++ = *src++;</b><br> 33 while( src < end )<br>
34 {<br> 35 if( src[0] <= 0x03 && !dst[-2] && !dst[-1] )<br> 36 *dst++ = 0x03;<br> 37 *dst++ = *src++;<br> 38 }<br> 39 return dst;<br> 40 }<br></blockquote>
<div><br><blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"> 51 void x264_nal_encode( x264_t *h, uint8_t *dst, x264_nal_t *nal )<br> 52 {<br> 53 uint8_t *src = nal->p_payload;<br>
54 uint8_t *end = nal->p_payload + nal->i_payload;<br> 55 uint8_t *orig_dst = dst;<br> 56 <br> 57 if( h->param.b_annexb )<br> 58 {<br> 59 if( nal->b_long_startcode )<br> 60 *dst++ = 0x00;<br>
61 <b>*dst++ = 0x00;</b><br> 62 <b>*dst++ = 0x00;</b><br> 63 *dst++ = 0x01;<br> 64 }<br> 65 else /* save room for size later */<br> 66 dst += 4;<br> 67 <br> 68 /* nal header */<br>
69 *dst++ = ( 0x00 << 7 ) | ( nal->i_ref_idc << 5 ) | nal->i_type;<br> 70 <br> 71 dst = h->bsf.nal_escape( dst, src, end );<br> 72 int size = (dst - orig_dst) - 4;<br> 73 <br> 74 /* Write the size header for mp4/etc */<br>
75 if( !h->param.b_annexb )<br> 76 {<br> 77 /* Size doesn't include the size of the header we're writing now. */<br> 78 orig_dst[0] = size>>24;<br> 79 orig_dst[1] = size>>16;<br>
80 orig_dst[2] = size>> 8;<br> 81 orig_dst[3] = size>> 0;<br> 82 }<br> 83 <br> 84 nal->i_payload = size+4;<br> 85 nal->p_payload = orig_dst;<br> 86 x264_emms();<br>
87 }<br></blockquote></div>