<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to avoid artifacts while modifying the code for MPEG4 packetization ? in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-avoid-artifacts-while-modifying-the-code-for-MPEG4/m-p/859339#M7559</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;I have modified the function EncodeISlice in mp4_enc_vop.cpp to reflect the following :&lt;/P&gt;
&lt;P&gt; nBitsInBuf = slice-&amp;gt;cBS.GetNumBits() - prevnBits;&lt;BR /&gt;  //slice-&amp;gt;cBS.&lt;BR /&gt;  // Number of bits for the macroblock&lt;BR /&gt;  nBits = slice-&amp;gt;cBS.GetNumBits(MBsPtr, MBsBitOff);&lt;BR /&gt;  &lt;BR /&gt;  if(nBitsInBuf &amp;gt; mVideoPacketLength)&lt;BR /&gt; {&lt;BR /&gt; Ipp32u numBytesToCopy;&lt;BR /&gt; Ipp32u EndBitOffset;&lt;BR /&gt; Ipp8u *TempBuffer;&lt;BR /&gt; Ipp32u numBitsRemaining;&lt;BR /&gt; Ipp32u ind;&lt;BR /&gt;&lt;BR /&gt; // mark MBs in current VideoPacket as invalid for prediction&lt;BR /&gt; &lt;BR /&gt; MBcurr-&amp;gt;block[1].validPredIntra = 0;&lt;BR /&gt; &lt;BR /&gt; for (i = 0; i &amp;lt; IPP_MIN(mbnvp, mNumMacroBlockPerRow + 1); i++) &lt;BR /&gt; {&lt;BR /&gt; MBcurr[-i].block[2].validPredIntra = MBcurr[-i].block[3].validPredIntra = 0;&lt;BR /&gt; MBcurr[-i].block[4].validPredIntra = MBcurr[-i].block[5].validPredIntra = 0;&lt;BR /&gt; }&lt;BR /&gt; &lt;/P&gt;
&lt;P&gt;What I am doing is that :&lt;/P&gt;
&lt;P&gt;Once the number of bytes in the output encoded b
uffer exceeds the RTP MTU length, &lt;/P&gt;
&lt;P&gt;I copy the encoded macroblock into a temporary buffer, then add the resync marker before this macroblock and mark the current macroblock invalid for MV prediction.&lt;/P&gt;
&lt;P&gt;It's different fro what u guys do ,where when the number of bits for macroblock exceeds videopacket length, u put the resync marker after the encoded macroblock.&lt;/P&gt;
&lt;P&gt;But, due to my modification, the depacketized and the decoded picture has some artifacts, like small bands appearing here and there, I am not sure whether I need to do anything more to fix it.&lt;/P&gt;
&lt;P&gt;Please find the sample video file attached.&lt;/P&gt;
&lt;P&gt;The IVOP distance is 90, BVOP is 0.&lt;/P&gt;
&lt;P&gt;Only the IVOPS are big and get split into multiple RTP packets,but once the IVOP is screwed, everything else follows :)&lt;/P&gt;
&lt;P&gt;Thanks a lot for your help,&lt;/P&gt;
&lt;P&gt;Ram&lt;/P&gt;
&lt;P&gt;p.s : Please rename the attache file to .m4v before playing it&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 30 May 2007 12:59:40 GMT</pubDate>
    <dc:creator>rramani80</dc:creator>
    <dc:date>2007-05-30T12:59:40Z</dc:date>
    <item>
      <title>How to avoid artifacts while modifying the code for MPEG4 packetization ?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-avoid-artifacts-while-modifying-the-code-for-MPEG4/m-p/859339#M7559</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;I have modified the function EncodeISlice in mp4_enc_vop.cpp to reflect the following :&lt;/P&gt;
&lt;P&gt; nBitsInBuf = slice-&amp;gt;cBS.GetNumBits() - prevnBits;&lt;BR /&gt;  //slice-&amp;gt;cBS.&lt;BR /&gt;  // Number of bits for the macroblock&lt;BR /&gt;  nBits = slice-&amp;gt;cBS.GetNumBits(MBsPtr, MBsBitOff);&lt;BR /&gt;  &lt;BR /&gt;  if(nBitsInBuf &amp;gt; mVideoPacketLength)&lt;BR /&gt; {&lt;BR /&gt; Ipp32u numBytesToCopy;&lt;BR /&gt; Ipp32u EndBitOffset;&lt;BR /&gt; Ipp8u *TempBuffer;&lt;BR /&gt; Ipp32u numBitsRemaining;&lt;BR /&gt; Ipp32u ind;&lt;BR /&gt;&lt;BR /&gt; // mark MBs in current VideoPacket as invalid for prediction&lt;BR /&gt; &lt;BR /&gt; MBcurr-&amp;gt;block[1].validPredIntra = 0;&lt;BR /&gt; &lt;BR /&gt; for (i = 0; i &amp;lt; IPP_MIN(mbnvp, mNumMacroBlockPerRow + 1); i++) &lt;BR /&gt; {&lt;BR /&gt; MBcurr[-i].block[2].validPredIntra = MBcurr[-i].block[3].validPredIntra = 0;&lt;BR /&gt; MBcurr[-i].block[4].validPredIntra = MBcurr[-i].block[5].validPredIntra = 0;&lt;BR /&gt; }&lt;BR /&gt; &lt;/P&gt;
&lt;P&gt;What I am doing is that :&lt;/P&gt;
&lt;P&gt;Once the number of bytes in the output encoded b
uffer exceeds the RTP MTU length, &lt;/P&gt;
&lt;P&gt;I copy the encoded macroblock into a temporary buffer, then add the resync marker before this macroblock and mark the current macroblock invalid for MV prediction.&lt;/P&gt;
&lt;P&gt;It's different fro what u guys do ,where when the number of bits for macroblock exceeds videopacket length, u put the resync marker after the encoded macroblock.&lt;/P&gt;
&lt;P&gt;But, due to my modification, the depacketized and the decoded picture has some artifacts, like small bands appearing here and there, I am not sure whether I need to do anything more to fix it.&lt;/P&gt;
&lt;P&gt;Please find the sample video file attached.&lt;/P&gt;
&lt;P&gt;The IVOP distance is 90, BVOP is 0.&lt;/P&gt;
&lt;P&gt;Only the IVOPS are big and get split into multiple RTP packets,but once the IVOP is screwed, everything else follows :)&lt;/P&gt;
&lt;P&gt;Thanks a lot for your help,&lt;/P&gt;
&lt;P&gt;Ram&lt;/P&gt;
&lt;P&gt;p.s : Please rename the attache file to .m4v before playing it&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2007 12:59:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-avoid-artifacts-while-modifying-the-code-for-MPEG4/m-p/859339#M7559</guid>
      <dc:creator>rramani80</dc:creator>
      <dc:date>2007-05-30T12:59:40Z</dc:date>
    </item>
  </channel>
</rss>

