实验要求:
1.将两个264文件解码得到相应的YUV文件
2.将以上两个视频序列编码为.264文件
3.用码流分析软件检查所生成的码流中各种编码模式和运动矢量等信息
4.用播放器观看所生成码流的质量
实验过程:
1.使用ldecod_vc10将两个视频进行解码,得到YUV文件
修改decoder.cfg文件中的参数,得到输出
2.使用lencod_vc10的工程文件将刚刚得到的两个YUV文件按照不同要求编码为264文件
固定码率,已不同的GOP长度及形状编码
InputFile = “128x128_dec.yuv” # Input sequence
FramesToBeEncoded = 50 # Number of frames to be coded
SourceWidth = 128 # Source frame width
SourceHeight = 128 # Source frame height
OutputWidth = 128 # Output frame width
OutputHeight = 128 # Output frame height
ReconFile = “128x128_rec.yuv” # Reconstruction YUV file
OutputFile = “128x128_rec_GOP15-2B.264” # Bitstream
IntraPeriod = 15 # Period of I-pictures (0=only first)
IDRPeriod = 0 # Period of IDR pictures (0=only first)
NumberBFrames = 2 # Number of B coded frames inserted (0=not used)
RateControlEnable = 0 # 0 Disable, 1 Enable
相同的GOP长度及形状,改变码率
InputFile = “flyer_converted_dec.yuv” # Input sequence
InputHeaderLength = 0 # If the inputfile has a header, state it’s length in byte here
StartFrame = 0 # Start frame for encoding. (0-N)
FramesToBeEncoded = 30 # Number of frames to be coded
OutputFile = “flyer_converted_rec_1000kbps.264” # Bitstream
IntraPeriod = 10 # Period of I-pictures (0=only first)
IDRPeriod = 0 # Period of IDR pictures (0=only first)
RateControlEnable = 1 # 0 Disable, 1 Enable
Bitrate = 1000000 # Bitrate(bps) – 可变 –
RCUpdateMode = 2 # Rate Control type. Modes supported :
# 0 = original JM rate control,
# 1 = rate control that is applied to all frames regardless of the slice type,
# 2 = original plus intelligent QP selection for I and B slices (including Hierarchical),
# 3 = original + hybrid quadratic rate control for I and B slice using bit rate statistics
#
3.用码流分析软件检查所生成的码流中编码模式和运动矢量等信息
分析第一个帧
分析第一个P帧
根据率失真曲线判断编码器优劣
GOP=12,2B帧:
GOP=9,2B帧:
GOP=4,1B帧:
GOP=12,无B帧:
GOP=2,全I帧:
绘制率失真曲线:
*固定GOP长度及形状(固定为GOP长度为15,2B帧):
3523kbps:
1805kbps:
1000kbps:
106kbps:
实验结论:
GOP组结构相同时,比特率越大,编码后文件失真越小;比特率相同时,GOP越短,编码后文件失真越大