在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 61428|回复: 115

[原创] 分享我的h.264 decoder, Verilog源码与工程

[复制链接]
发表于 2017-5-24 18:50:27 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
分享我的h.264 decoder, verilog源码与工程。
这是我从2011年开始写的, 一开始只是支持640x480分辨率,在cyclone4 e40上的, 没有实现deblocking filter, 帧率也只有25fps。
最近接了个无人机h.264 FPGA解码的项目, 需要实现720p 60fps及的blocking filter,经过几个月的修改。终于完成了。
这里公开我原来在cyclone4 e40上的的的源码与工程, 和在米尔zturn zynq7020开发板及黑金zynq 7020上能解码720p 60fps的sd卡镜像,有板子的朋友可以试试。
下面是最新版本的datasheet,希望有项目合作的机会。
Function Overview.

Osenlogic OSD10receives the h.264 NAL stream from a fifo from external memory, and it decodesit to YUV 4:2:0, then store to external memory.

OsenLogic OSD10includes bitstream parser(expglomb and CAVLC), IDCT/Iquant(residual), Intrapredictor and inter predictor and deblocking filter.

All areimplemented in Verilog hdl. The decoder can work without cpu or with CPU.

block overview

block overview





3.Interface Signals

Signal Name

Direction

Description

rst_n

Input

Global reset

clk

Input

Main decoder clock

ext_mem_rd_clk

Input

The clock associated with the external memory reader

ext_mem_wr_clk

Input

The clock associated with the external memory writer

ena

Input

Enable the decoder

stream_mem_data_in

Input

The stream data from stream fifo

stream_data_valid

Input

High when stream data is avialible from stream fifo

stream_mem_rd

Output

High when the decoder request data from stream fifo

ext_mem_init_done

Input

High when external memory finished initialization

ext_mem_writer_burst

Output

Indicate the start of write burst

ext_mem_burst_len_minus1

Output

When ext_mem_writer_burst_len_minus1 is High, indicated the length of write burst

ext_mem_writer_ready

Input

High wehn external memory is able to accept data from memory

ext_mem_writer_addr

Output

Valid when ext_mem_writer_burst is high,indicate the address writing to external memory

ext_mem_writer_data

Output

The data from the decoder to external memory

ext_mem_writer_valid

Ouput

High wehn the data from the decoder is availible to external mem

ext_mem_reader_burst_ready

Input

High when external memory is ready to accept data from the decoder

ext_mem_reader_burst

Output

Indicate the start of read burst

ext_mem_reader_burst_len_minus1

Output

When ext_mem_reader_burst_len_minus1 is High, indicated the length of read burst

ext_mem_reader_ready

Output

High when decoder is able to accept data form exterl memory

ext_mem_reader_data

Input

Data being read from external memory

ext_mem_reader_valid

Input

High when external memory data is availible

pic_width_in_mbs

Output

Total MBs in width

pic_height_in_map_units

Output

Total MBs in height

total_mbs_one_frame

Output

Total MBs in frame

start_of_frame

Output

High when start of decoding frame

end_of_frame

Output

High when end of a decoding frame

pic_num

Output

Total decode frames

mb_index

Output

Current decoding mb_index




4.Specifications

Model

Osen Logic OSD10 h.264 decoder

Profile

Baseline

Level

3.1

Input Format

H.264 NAL stream

Output Format

YUV4:2:0

Slice type supported

I,SI,P,SP

Entropy Coding

CAVLC

Supported frme sizes

Max: 1920x1088
Min:640x480

Supported bitrate

0 to 10Mps
No decode rate control

Max supported resolution at max frame rate

1920x1088 @ 30fps, decoder clock working at 75M

Required external memory size

32Mbyte

External memory reader interface data width

64bit

External memory writer interface data width

32bit

Osenlogic_OSD10_datasheet.pdf

551.39 KB, 下载次数: 528 , 下载积分: 资产 -2 信元, 下载支出 2 信元

 楼主| 发表于 2017-5-24 21:25:45 | 显示全部楼层
本帖最后由 eebinqiu 于 2017-5-28 22:48 编辑

源码和sd卡镜像
myir zynq 7020或黑金ax7020播放1080p镜像, 可以用dd或
Win32DiskImager写入sd卡,sd >=2GB

bitstream.part1.rar

14 MB, 下载次数: 1206 , 下载积分: 资产 -5 信元, 下载支出 5 信元

bitstream.part2.rar

1.61 MB, 下载次数: 407 , 下载积分: 资产 -2 信元, 下载支出 2 信元

zturn264_trial.part001.rar

15 MB, 下载次数: 860 , 下载积分: 资产 -5 信元, 下载支出 5 信元

zturn264_trial.part002.rar

15 MB, 下载次数: 920 , 下载积分: 资产 -5 信元, 下载支出 5 信元

zturn264_trial.part003.rar

15 MB, 下载次数: 893 , 下载积分: 资产 -5 信元, 下载支出 5 信元

zturn264_trial.part004.rar

15 MB, 下载次数: 849 , 下载积分: 资产 -5 信元, 下载支出 5 信元

zturn264_trial.part005.rar

15 MB, 下载次数: 815 , 下载积分: 资产 -5 信元, 下载支出 5 信元

zturn264_trial.part006.rar

15 MB, 下载次数: 815 , 下载积分: 资产 -5 信元, 下载支出 5 信元

zturn264_trial.part007.rar

15 MB, 下载次数: 762 , 下载积分: 资产 -5 信元, 下载支出 5 信元

zturn264_trial.part008.rar

15 MB, 下载次数: 816 , 下载积分: 资产 -5 信元, 下载支出 5 信元

zturn264_trial.part009.rar

15 MB, 下载次数: 784 , 下载积分: 资产 -5 信元, 下载支出 5 信元

zturn264_trial.part010.rar

15 MB, 下载次数: 773 , 下载积分: 资产 -5 信元, 下载支出 5 信元

zturn264_trial.part011.rar

15 MB, 下载次数: 746 , 下载积分: 资产 -5 信元, 下载支出 5 信元

zturn264_trial.part012.rar

9.35 MB, 下载次数: 386 , 下载积分: 资产 -4 信元, 下载支出 4 信元

ax7020_264_try.part001.rar

15 MB, 下载次数: 972 , 下载积分: 资产 -5 信元, 下载支出 5 信元

ax7020_264_try.part002.rar

15 MB, 下载次数: 992 , 下载积分: 资产 -5 信元, 下载支出 5 信元

ax7020_264_try.part003.rar

15 MB, 下载次数: 927 , 下载积分: 资产 -5 信元, 下载支出 5 信元

ax7020_264_try.part004.rar

15 MB, 下载次数: 967 , 下载积分: 资产 -5 信元, 下载支出 5 信元

ax7020_264_try.part005.rar

14.06 MB, 下载次数: 954 , 下载积分: 资产 -5 信元, 下载支出 5 信元

发表于 2017-5-24 22:56:57 | 显示全部楼层
回复 1# eebinqiu


     非常谢谢楼主的分享
发表于 2017-5-25 03:24:53 | 显示全部楼层
发表于 2017-5-25 09:00:25 | 显示全部楼层
楼主很强
发表于 2017-5-25 10:04:25 | 显示全部楼层
强。。。
发表于 2017-5-29 20:20:28 | 显示全部楼层
能贴出来就知道楼主很牛逼
发表于 2017-5-31 14:18:24 | 显示全部楼层
楼主,请问这个IP占多少FPGA资源?
 楼主| 发表于 2017-6-1 11:37:03 | 显示全部楼层
回复 8# anon1118


    zynq7020整个系统占70%,ip占57%,资源占的挺多的,但是并行度高,75M可完成1080p解码
发表于 2017-6-1 14:54:34 | 显示全部楼层
好东西必须得支持下
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

×

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-3-28 16:17 , Processed in 0.036100 second(s), 8 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表