<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:Consolas">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">The H264VideoStreamParser::Parse() method appears to insert additional 0x00000001 start codes when the buffered data is greater than the BANK_SIZE and the fBank[] banks are switched.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Steps to reproduce:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> 1. Convert a H.264 video such as the Live555 sample slamtv10.264 file<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> to MPEG-TS using testProgs/testH264VideoToTransportStream.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> 2. Demux the H.264 data from the MPEG-TS file. (I used a modified<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> version of testProgs/MPEG2TransportStreamIndexer).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> 3. Compare the demuxed H.264 data with the input H.264 file.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">In the output file at every BANK_SIZE (approx) offset there is an addition 0x00000001 start code compared to the source data. This doesn't (generally occur) at the start of a NAL unit.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">The first difference occurs after the byte sequence 0x94caf7ce in the TS or H.264 files (using slamtv10.264 as an input). It is followed by an extra 0x00000001:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> ...<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> 94ca f7ce <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> 0000 0001 <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> 83f3 539b<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> ...<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">The demuxed H.264 data causes the JM H.264 reference decoder to complain:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> http://iphome.hhi.de/suehring/tml/<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> Error: Found NALU with forbidden_bit set, bit error?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">It is probably caused by StreamParser::ensureValidBytes1() throwing an (intended) exception after the BANK_SIZE buffer is full which causes a re-entry to H264VideoStreamParser::parse() which in turn does
save4Bytes(0x00000001) when fOutputStartCodeSize is non-zero. However, it may not be valid to add the start code in this case.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">This was tested with Live555 version "2012.04.18".<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Do you think this is an issue or is it valid output?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">John.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">-- <o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<font face="monospace">--------------------------------------------------------------<br>
Intel Shannon Limited<br>
Registered in Ireland<br>
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare<br>
Registered Number: 308263<br>
Business address: Dromore House, East Park, Shannon, Co. Clare<br>
<br>
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.<br>
</font></body>
</html>