###Date: 2018.5.20ide
================================================================oop
分類:AVS視頻編解碼this
AVS1標準是中國自主研發的音視頻編解碼標準,主要用於國內衛星電視的壓縮傳輸,其壓縮率相較於H.264要低一些,在使用範圍和推廣上也不如H.264。編碼
AVS1標準參考代碼RM下載地址:https://download.csdn.net/download/soaringlee_fighting/10425909spa
編譯方法很簡單,打開RM.dsw,分別運行lencod.dsw和ldecod.dsw便可。.net
編碼後的avs碼流爲test.avs,固然能夠在encoder.cfg配置文件中進行設置。編碼重建yuv爲test_rec.yuv。命令行
解碼yuv爲test_dec.yuv。code
編碼過程以下圖所示:orm
(場編碼)視頻
(幀編碼)
解碼過程以下圖所示:
解碼yuv:
-f file If an -f <config> parameter is present in the command line then the parameters will be taken from the config file See configfile.h for a list of supported ParameterNames. -p parameter=value If -p <ParameterName = ParameterValue> parameters are present then the ParameterValue will overide the config file's settings. There must be whitespace between -f and -p commands and their respecitive parameters.
AVS1解碼器生成在bin下面爲ldecod.exe
ldecod.exe decoder.cfg
The decoder configuration file name must be provided as the first parameter. All decoding parameters are read from this file.
編碼器配置文件encoder.cfg:
# New Input File Format is as follows # <ParameterName> = <ParameterValue> # Comment # See configfile.h for a list of supported ParameterNames ########################################################################################## # Files ########################################################################################## InputFile = "E:\origCfP\BasketballPass_416x240_50.yuv" # Input sequence, YUV 4:2:0 InputHeaderLength = 0 # If the inputfile has a header, state it's length in byte here FramesToBeEncoded = 10 # Number of frames to be coded SourceWidth = 416 # Image width in Pels, must be multiple of 16 SourceHeight = 240 # Image height in Pels, must be multiple of 16 TraceFile = "trace_enc.txt" ReconFile = "test_rec.yuv" OutputFile = "test.avs" ########################################################################################## # Encoder Control ########################################################################################## ProfileID = 32 # Profile ID (32: Jizhun Profile) LevelID = 64 # Level ID (16: 2.0; 32: 4.0; 34: 4.2; 64: 6.0; 66: 6.2) IntraPeriod = 15 # Period of I-Frames (0=only first) VECPeriod = 0 # Period of VEC, distance between two sequence headers (0=doesn't exist at the bitstream) SeqHeaderPeriod = 0 # Period of Sequence Header, Number of IntraPeriod (0=only first) QPFirstFrame = 28 # Quant. param for first frame (intra) (0-63) QPRemainingFrame = 28 # Quant. param for remaining frames (0-63) QPBPicture = 28 # Quant. param for B frames (0-63) UseHadamard = 1 # Hadamard transform (0=not used, 1=used) SearchRange = 32 # Max search range NumberReferenceFrames = 2 # Number of previous frames used for inter motion search (1-5) InterSearch16x16 = 1 # Inter block search 16x16 (0=disable, 1=enable) InterSearch16x8 = 1 # Inter block search 16x8 (0=disable, 1=enable) InterSearch8x16 = 1 # Inter block search 8x16 (0=disable, 1=enable) InterSearch8x8 = 1 # Inter block search 8x8 (0=disable, 1=enable) ########################################################################################## # B Frames ########################################################################################## NumberBFrames = 0 # Number of B frames inserted (0=not used) FrameSkip = 2 # Number of frames to be skipped in input (e.g 2 will code every third frame) ########################################################################################## # RD Optimization ########################################################################################## RDOptimization = 1 # rd-optimized mode decision (0:off, 1:on) ########################################################################################## # Additional Stuff ######################################################################################### Progressive_frame = 1 # (0: Interlace, 1: Progressive) InterlaceCodingOption = 0 # (0: frame coding, 1: Field coding, 2: PAFF) repeat_first_field = 0 top_field_first = 1 ########################################################################################## # Loop filter parameters ########################################################################################## LoopFilterDisable = 0 # Disable loop filter in picture header (0=Filter, 1=No Filter) LoopFilterParameter = 0 # Send loop filter parameter (0= No parameter, 1= Send Parameter) LoopFilterAlphaOffset = 0 # Aplha offset in loop filter LoopFilterBetaOffset = 0 # Beta offset in loop filter ########################################################################################## # Slice parameters ########################################################################################## NumberOfRowsInSlice = 5 # number of MB rows in one Slice (0: one slice per frame) ########################################################################################## # Weighting Prediction parameters ########################################################################################## WeightEnable = 0 # Weighting Prediction ( 0 = disable , 1 = enable) ########################################################################################## #frame rate ########################################################################################### FrameRate = 5 # (1: 24000/1001,2: 24,3: 25,4: 30000/1001,5: 30,6: 50,7: 60000/1001,8: 60)###### ########################################################################################### #chroma format parameter ########################################################################################### ChromaFormat = 1 # (1=4:2:0,2=4:2:2) ######################################################################################## #Rate control ######################################################################################## RateControlEnable = 0 # 0 Disable, 1 Enable Bitrate = 6000000 # Bitrate(bps) InitialQP = 36 # Initial Quantization Parameter for the first I frame # InitialQp depends on two values: Bits Per Picture, # and the GOP length BasicUnit = 8160 # Number of MBs in the basic unit # should be a fractor of the total number # of MBs in a frame ChannelType = 0 # type of channel( 1=time varying channel; 0=Constant channel)
解碼器配置文件decoder.cfg:
test.avs ........AVS coded bitstream test_dec.yuv ........Output file, YUV 4:2:0 format test_rec.yuv ........Ref sequence (for SNR) 2 ........Number of reference frame buffers, for memory managemnt only 0 ........Loopfilter disable(0: filter, 1: no loopfilter) This is a file containing input parameters to the Telenor H.26L decoder. The text line following each parameter is discarded by the decoder.========================================================================
好了,到這裏已經講清楚了AVS1編解碼器的簡單使用方法了。
至於在Linux/Unix下面的編譯,也是很簡單的,直接make就好了。
Makefiles are provided in the lencod and ldecod directory. 'make' comand will creat the obj directory and generate the executable file in the 'bin' directory.