<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[H264 ENCODER RTL V2.0仿真教程]]></title><description><![CDATA[<ul>
<li>
<p dir="auto">Download the <a href="http://www.openasic.org/topic/79/h264-video-encoder-rtl-ip-core-version-2-0"><em>H264 Video Encoder RTL IP Core V2.0</em></a></p>
</li>
<li>
<p dir="auto">解压后将得到四个文件夹， 其中“<code>sw</code>”用于产生测试向量，“<code>sim</code>”是仿真文件，“<code>rtl</code>”是IP Core的所有代码，“<code>lib</code>”是memory行为级模型<br />
<img src="/assets/uploads/files/1564741962655-43b466b6-caa5-4a37-9786-3526a28ec0d2-image.png" alt="0_1564742014688_43b466b6-caa5-4a37-9786-3526a28ec0d2-image.png" class=" img-fluid img-markdown" /></p>
</li>
<li>
<p dir="auto">进入“<code>sw</code>”文件夹中，通过命令行修改参数，示例如下：<br />
<code>f264.exe -i BlowingBubbles_416x240_50.yuv -o BlowingBubbles_416x240_50.264 -r BlowingBubbles_416x240_50_rec.yuv -w 416 -h 240 -g 5 -f 10 -q 27</code><br />
其中，<br />
<code>-i</code>：待编码的YUV文件位置<br />
<code>-o</code>：输出码流文件位置<br />
<code>-r</code>：输出重建帧位置<br />
<code>-w</code>：YUV序列宽<br />
<code>-h</code>：YUV序列高<br />
<code>-g</code>：GOP长度<br />
<code>-f</code>：编码帧数<br />
<code>-q</code>：QP值</p>
</li>
<li>
<p dir="auto">在windows下执行<code>f264.exe</code>文件，运行结果如下：<br />
<img src="/assets/uploads/files/1564742303385-6c2de939-3ec3-456c-ae9d-ac6ffd3f590b-image.png" alt="0_1564742355455_6c2de939-3ec3-456c-ae9d-ac6ffd3f590b-image.png" class=" img-fluid img-markdown" /><br />
除了码流文件和重建帧文件外，还将产生<code>cur_mb_p4.dat</code>和<code>bs_check.dat</code>两个文件。前者作为硬件编码器的YUV输入，后者作为软硬件交叉验证的测试输入。<br />
将上述两个文件放到“<code>/sim/top_testbench/tv</code>”下。</p>
</li>
<li>
<p dir="auto">修改“<code>tb_top.v</code>”中的参数，确保与软件参数一致，示例如下：<br />
<code> `define FRAMEWIDTH 416</code><br />
<code> `define FRAMEHEIGHT 240</code><br />
<code> `define GOP_LENGTH 5</code><br />
<code> `define FRAME_TOTAL 100</code><br />
<code> `define INIT_QP 27</code><br />
根据需要，可以打开“<code>tb_top.v</code>”中的dump开关。</p>
</li>
<li>
<p dir="auto">运行仿真，命令行输入“<code>vsim -c -do sim.do</code>”，仿真正确应如下图所示：<br />
<img src="/assets/uploads/files/1564742329294-b043b593-b003-4d6c-a285-868aa3cb5679-image.png" alt="0_1564742381297_b043b593-b003-4d6c-a285-868aa3cb5679-image.png" class=" img-fluid img-markdown" /><br />
若软硬件参数不一致或出现其他bug，仿真会停止，如下：<br />
<img src="/assets/uploads/files/1564742336690-f8003742-1d1a-4e90-bb1f-220fbce0ac9e-image.png" alt="0_1564742388738_f8003742-1d1a-4e90-bb1f-220fbce0ac9e-image.png" class=" img-fluid img-markdown" /></p>
</li>
</ul>
]]></description><link>http://www.openasic.org/topic/82/h264-encoder-rtl-v2-0仿真教程</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Apr 2026 23:43:16 GMT</lastBuildDate><atom:link href="http://www.openasic.org/topic/82.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 02 Aug 2019 11:30:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to H264 ENCODER RTL V2.0仿真教程 on Tue, 09 Apr 2024 01:13:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jett" aria-label="Profile: Jett">@<bdi>Jett</bdi></a> 应该是两者统一就好了，不然仿真会报错</p>
]]></description><link>http://www.openasic.org/post/589</link><guid isPermaLink="true">http://www.openasic.org/post/589</guid><dc:creator><![CDATA[damian]]></dc:creator><pubDate>Tue, 09 Apr 2024 01:13:22 GMT</pubDate></item><item><title><![CDATA[Reply to H264 ENCODER RTL V2.0仿真教程 on Thu, 28 Dec 2023 01:47:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kaol" aria-label="Profile: KAol">@<bdi>KAol</bdi></a> 我有个小疑问，执行f264.exe 后面参数 -f 给了10。 但是tb_top.v这个文件确实`define FRAME_TOTAL 100。这个地方是不是没有完全匹配上？</p>
]]></description><link>http://www.openasic.org/post/572</link><guid isPermaLink="true">http://www.openasic.org/post/572</guid><dc:creator><![CDATA[Jett]]></dc:creator><pubDate>Thu, 28 Dec 2023 01:47:25 GMT</pubDate></item><item><title><![CDATA[Reply to H264 ENCODER RTL V2.0仿真教程 on Mon, 27 Nov 2023 15:02:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kaol" aria-label="Profile: KAol">@<bdi>KAol</bdi></a> 您好，有成功仿真，非常感謝！也有想請教的地方是，我有嘗試使用JM來進行編碼，但發現使用此encoder(V2.0）的結果與JM編碼結果有差異，想詢問會是有哪些原因？謝謝！</p>
]]></description><link>http://www.openasic.org/post/571</link><guid isPermaLink="true">http://www.openasic.org/post/571</guid><dc:creator><![CDATA[JimmyWu11054]]></dc:creator><pubDate>Mon, 27 Nov 2023 15:02:06 GMT</pubDate></item><item><title><![CDATA[Reply to H264 ENCODER RTL V2.0仿真教程 on Tue, 16 Mar 2021 09:26:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/yafei" aria-label="Profile: yafei">@<bdi>yafei</bdi></a> 我也有这个疑问。这个问题解决了吗？麻烦问下有没有将码流转换成 NAL 包的软件啊？谢谢！</p>
]]></description><link>http://www.openasic.org/post/442</link><guid isPermaLink="true">http://www.openasic.org/post/442</guid><dc:creator><![CDATA[WCE]]></dc:creator><pubDate>Tue, 16 Mar 2021 09:26:30 GMT</pubDate></item><item><title><![CDATA[Reply to H264 ENCODER RTL V2.0仿真教程 on Fri, 08 Jan 2021 07:18:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kaol" aria-label="Profile: KAol">@<bdi>KAol</bdi></a> bs_check.dat对应到H264标准中，是什么格式。bs_check.dat是如何转成BlowingBubbles_416x240_50.264, 不仅仅是加上sps,pps,slice_header这些吧，将BlowingBubbles_416x240_50.264第一个mb的编码结果提取出来，感觉跟bs_check.dat没有什么关系。也就是说，如何将bs_check.dat转成图片，进行可视化？</p>
]]></description><link>http://www.openasic.org/post/434</link><guid isPermaLink="true">http://www.openasic.org/post/434</guid><dc:creator><![CDATA[yafei]]></dc:creator><pubDate>Fri, 08 Jan 2021 07:18:56 GMT</pubDate></item></channel></rss>