Summary of the invention
Test realizes that by manual analysis efficient is low to one object of the present invention to the AVS code stream in the prior art in order to overcome, and the defective of easily makeing mistakes provides a kind of AVS video-frequency basic flow test analysis equipment, realizes full test, analysis to the AVS code stream.
Another object of the present invention is for the grammer of verifying AVS video code flow compression, semanteme conformance with standard whether, and estimate the quality of corresponding encoded device, thereby provide the AVS video-frequency basic flow method for testing and analyzing on a kind of AVS of being applied to video-frequency basic flow test analysis equipment.
To achieve these goals, the invention provides a kind of AVS video-frequency basic flow method for testing and analyzing, may further comprise the steps:
1), input AVS code stream and the corresponding original YUV code stream that will analyze, if the AVS code stream is a transport stream, then the AVS code stream of being imported is carried out demultiplexing, extract video-frequency basic flow, if input is the AVS video-frequency basic flow, then directly analyze;
2), the video-frequency basic flow in the AVS code stream is analyzed, show decoded image in real time, and the sequence summary info in the video-frequency basic flow, frame summary info and macro block summary info, simultaneously video-frequency basic flow is done the standard consistency check; Wherein, described video-frequency basic flow analysis in the AVS code stream is comprised:
2-1), read AVS video-frequency basic flow data, judge whether current data is the end point of code stream, if, withdraw from analysis, if not, carry out next step;
2-2), judge whether current data are initial codes of sequence, if resolve the sequence summary, and choose each parameter in sequence abstract fields and the sequence, execution in step 2-9), if not, carry out next step;
2-3), judge whether current data is frame head, if, the summary info of parse for frame, and execution in step 2-9), if not, carry out next step;
2-4), judge whether current data is slice header, if then resolve slice header, and execution in step 2-9), realizes consistency checking, if by checking to the slice header summary info, then carrying out next step, is not slice header as if current data, then execution in step 2-8);
2-5), the macro block of decoding in the current band, and macro block counted, upgrade macro block summary and movable information then, and obtain the motion compensation or the motion estimation information of macro block;
2-6), judge whether all macro blocks have all been finished decoding in the current band, if, then carry out next step, otherwise, repeated execution of steps 2-5);
2-7), judge whether all macro blocks have all been finished decoding in the present frame, if, then upgrade the frame summary info that to export to the user, find the respective frame of original YUV file then, calculate the Y-PSNR of present frame, corresponding contents is added up, is preserved statistical information, and return step 2-1) continue to analyze; If not, directly return step 2-1), continue reading of data with next band of decoding;
2-8), judge whether current data is the sequence termination message, if then finish analytic process, if not, then continue to judge whether current data is other extension header information, if, then skip this segment encode stream, return step 2-1) continue the information of reading in, if not extension header information, then the information of reading in being made legitimacy judges, be illegal information, give the alarm whether finish by user's discriminatory analysis process, not illegal information, then finish this sequence analysis;
2-9), the summary info to input carries out the standard consistency checking, whether verification test code stream form and each field value meet the AVS standard criterion, if meet the AVS standard, then summary info is exported to the user and upgraded user's summary display message, re-execute step 2-1 then), if do not meet the AVS standard, then give the alarm and remind the user, whether the user determines termination analysis according to actual conditions, if termination analysis, then withdraw from analytic process, termination analysis is not then skipped this segment encode stream and is returned step 2-1) reading of data proceeds to analyze;
3), video-frequency basic flow being carried out daily record checks.
In the technique scheme, in described step 1), described transport stream is the multiplex stream that video-frequency basic flow and audio frequency flow substantially, described demultiplexing is by searching the pid value of the video streaming data packet in the respective program stream in the transport stream, extract corresponding video streaming data packet, be combined into video-frequency basic flow.
In the technique scheme, in described step 3), described daily record the has comprised detail record TRACE journal file of decoding process, write down in analytic process to be run into wrong error log file and to the statistical information of journal file.
In the technique scheme, described sequence summary info comprises: video sequence file is size always, totalframes, total reproduction time, total bit number, average bit rate, average frame per second, video image pixel size, coding structure, code stream form and class thereof and rank.
In the technique scheme, described frame summary info comprises: current frame number, present frame reproduction time, frame pixel size, frame type, coding mode, the location of present frame initial code in code stream, the bit number that present frame takies.
In the technique scheme, described macro block summary info comprises: current macro place frame number, relative macro block sequence number in the current macro place bar reel number, frame, macro block unit location, pixel unit location, macro-block coding pattern, sub-macro block (8 * 8) coding mode, sub-macro block (8 * 8) forward direction/reverse vector value, quantization step, coding takies bit number.
Concrete motion compensation/the motion estimation information of described macro block comprises: macro block (mb) type and front/rear to motion vector.
In the technique scheme, describedly can do the batch processing analysis to video-frequency basic flow, described batch processing analysis is meant once can analyze the basic stream file of several differences simultaneously, then analysis result tabulation is shown, comprise that in table the summary info of each frame in each basic stream file and each flow the statistical information of sequence substantially.
A kind of and the corresponding AVS video-frequency basic flow of AVS video-frequency basic flow method for testing and analyzing test analysis equipment, this equipment comprises input unit 100, analytic unit 120 is checked in daily record, batch processing analytic unit 130 and output unit 140, also comprise real time inspection analytic unit 110, wherein
Described input unit 100 is imported AVS code stream and the original YUV code stream that will analyze, and transport stream is carried out demultiplexing, extracts the video-frequency basic flow that will analyze;
Described real time inspection analytic unit 110 obtains the AVS video-frequency basic flow from input unit 100, and the data of video-frequency basic flow are analyzed, obtain sequence, frame, the band in the code stream, the information and the decoded image of macro block, and the sequence summary info that will show in real time, frame summary info and macro block summary info output in the output unit 140;
Described daily record checks that analytic unit 120 obtains the journal file in the analytic process from real time inspection analytic unit 110, the content of analytic unit 120 analysis journal files is checked in daily record, check source code flow information, sum up The result of statistics, at last the result is outputed to output unit 140 and be shown to the user;
Described batch processing analytic unit 130 is analyzed the back and is outputed to output unit 140 with the journal file form from input unit 100 a plurality of video-frequency basic flows of input and original YUV files;
Described output unit 140 adopts LCD, shows the result who exports or the AVS video-frequency basic flow is done test analysis with the output of disk file form in real time.
The present invention can alleviate the loaded down with trivial details manual testing's analytical work of AVS video code flow, makes the test job of the AVS video code flow simple specification that becomes.
Embodiment
Below in conjunction with the drawings and specific embodiments, method of the present invention and corresponding apparatus are described.
AVS video-frequency basic flow method for testing and analyzing of the present invention may further comprise the steps:
AVS code stream and corresponding original YUV code stream that step 10, input will be analyzed, if the AVS code stream of input is a transport stream, then the AVS code stream of being imported is carried out demultiplexing, extract video-frequency basic flow, if input is the AVS video-frequency basic flow, then directly analyze.Transport stream is the multiplex stream that video-frequency basic flow and audio frequency flow substantially, and method of the present invention is will video-frequency basic flow be tested, analyze, therefore, and before the AVS code stream is performed an analysis, if input code flow is a transport stream, then need it to be extracted from input code flow by demultiplexing.Demultiplexing is by searching the pid value of the video streaming data packet in the respective program stream in the transport stream, extract corresponding video streaming data packet, being combined into video flowing.
Step 20, the video-frequency basic flow in the AVS code stream is analyzed, and shown in real time.In this step, the analytic process to the AVS video-frequency basic flow mainly comprises following steps:
Step 21, read AVS video-frequency basic flow data, judge whether current data is the end point of code stream, if, withdraw from analysis, if not, carry out next step;
Step 22, judge whether current data are initial codes of sequence, if, to resolve the sequence summary, and choose each parameter in sequence abstract fields and the sequence, execution in step 29 if not, is carried out next step;
In this step, resulting video sequence summary mainly comprises following content:
Video sequence file is size always
Totalframes
Total reproduction time
Total code word number
Average bit rate bits/s
Average frame per second frames/s
Video image pixel size: QCIF (176 * 144)/CIF (352 * 288)/ITU_601 (720 * 576)/720P (1280 * 720)/1080i (1920 * 1080)
Coding structure (frame/field, line by line/interlacing)
Code stream form (AVS) and class/rank thereof
Step 23, judge whether current data is frame head, if the summary info of parse for frame, and execution in step 29 if not, are carried out next step;
In this step, the frame summary info comprises following content:
Current frame number frame_num
The present frame reproduction time
Frame pixel size (QCIF176 * 144/CIF352 * 288/SD720 * 576/HD1280 * 720)
Frame type (I/B/P)
Coding mode (field/frame)
The location of present frame initial code in code stream
This frame takies bit number
Step 24, judge whether current data is slice header, if, then resolve slice header, and execution in step 29, realize consistency checking to the slice header summary info, if by checking, then carry out next step, if current data is not a slice header, then execution in step 28;
Step 25, the macro block of decoding in the current band, and macro block counted, upgrade macro block summary and movable information then, and obtain the concrete motion compensation/motion estimation information of macro block;
In this step, resulting macro block summary info comprises:
(mouse indication) current macro place frame number frame_num
Current macro place bar reel number slice_num
Relative macro block sequence number MB_num in the frame
Macro block unit location (MB_x, MB_y)
Pixel unit location (pixel_x, pixel_y)
Locate in the bit stream
Macro-block coding pattern
Sub-macro block (8 * 8) coding mode
Sub-macro block (8 * 8) forward direction/reverse vector value
Quantization step
Coding takies bit number
Except the macro block summary info, this step also can obtain the motion compensation/motion estimation information of macro block, specifically comprises:
Macro block (mb) type (marking) with different colours
Motion vector (arrow mark)
Step 26, judge whether that all macro blocks have all been finished decoding in the current band, if, then carry out next step, otherwise, repeated execution of steps 25;
Step 27, judge whether that all macro blocks have all been finished decoding in the present frame, if, then upgrade the frame summary info that to export to the user, find the respective frame of original YUV file, calculate the Y-PSNR (PSNR) of present frame, corresponding contents is added up, preserved statistical information, and return step 21 and continue to analyze; If not, directly return step 21, continue reading of data with next band of decoding;
The statistical information that this step will be preserved comprises:
The bit number that the same macro block position of different frame is average
Used bit number of macro block of same frame inner average coding
The average quantization value
Macroblock coding is the frequency of intra type
Step 28, judge whether current data is the sequence termination message, if, then finish analytic process, if not, then continue to judge whether current data is other extension header information, for example sequence shows expansion, the camera parameters expansion, copyright extension etc., if, then skip this segment encode stream, return step 21 and continue the information of reading in.If the information of reading in is not extension header information, then the information of reading in is made legitimacy and judge, judge whether by the user whether analytic process finishes if invalid information then gives the alarm, if not invalid information, then finish this sequence analysis.
Step 29, to the input summary info carry out the AVS consistency checking, whether verification test code stream form and each field value meet the AVS standard criterion, if meet the AVS standard, then summary info is exported to the user and upgraded user's summary display message, if do not meet the AVS standard, then give the alarm and remind the user, the user judges whether termination analysis according to actual conditions, if termination analysis, then withdraw from analytic process, if termination analysis is not then skipped this segment encode stream and is returned step 21 reading of data and proceed to analyze.
In this step, display sequence summary info, frame summary info and macro block summary info in real time.
Step 30, video-frequency basic flow is carried out daily record check.In the analytic process of step 20, the information that obtains can not all show in real time, need check resulting daily record in the analytic process.The daily record of being checked can comprise many aspects,
Step 31, check the TRACE journal file, this document detail record decoding process.
Step 32, check that the institute that error log file, this document write down in analytic process to be run into is wrong.
Step 33, check the raw information code stream.Can check with hexadecimal, ASCII character form respectively, and can search the relevant position data according to absolute, the relative address of user's appointment.The user can also be according to the personal like, the byte number (4/8/16/32bytes) of selecting every row to show.
Step 34, check statistical information.Open and check the analysis journal file, and the scope of statistics of selecting according to the user (N~M frame) and statistical content (quantization parameter, Y-PSNR, every frame intra piece number, every frame encode with bit number etc.), the counting statistics result.
Method of the present invention can also be done the batch processing analysis to video-frequency basic flow, described batch processing analysis is meant once can analyze the basic stream file of several differences simultaneously, then the analysis result tabulation is shown, the summary info that in table, comprises each frame in each basic stream file, as type of coding, quantization parameter, Y-PSNR, coding with bit number etc.; And each flows the statistical information of sequence substantially, as average code check, average peak signal to noise ratio etc.
The present invention also provides a cover and the corresponding AVS video-frequency basic flow of AVS video-frequency basic flow method for testing and analyzing of the present invention test analysis equipment, this cover testing equipment adopts portable high-performance calculation platform (as the ACME850 computer), be divided into according to function: input unit 100, real time inspection analytic unit 110, analytic unit 120 is checked in daily record, batch processing analytic unit 130 and output unit 140.
The effect of input unit 100 is AVS code stream and original YUV code streams that input will be analyzed.If the AVS code stream of input is a transport stream, then need carry out demultiplexing to transport stream at this element, extract the video-frequency basic flow that will analyze.Input unit 100 is sent to the AVS video-frequency basic flow in the real time inspection analytic unit 110, the data of 110 pairs of video-frequency basic flows of real time inspection analytic unit are analyzed, obtain sequence, frame, the band in the code stream, the information and the decoded image of macro block, and the sequence summary info that can show in real time, frame summary info and macro block summary info output in the output unit 140 demonstration in real time.Real time inspection analytic unit 110 also will write down corresponding journal file when analyzing.
The journal file that real time inspection analytic unit 110 will obtain in analytic process is sent to daily record and checks in the analytic unit 120, the content of analytic unit 120 analysis journal files is checked in daily record, check source code flow information, sum up The result of statistics, at last the result is shown to the user by output unit 140.。
Batch processing analytic unit 130 is analyzed the back and is exported to the client with the journal file form from input unit 100 a plurality of video-frequency basic flows of input and original YUV files.
Output unit 140 adopts LCD, shows the result who exports or the AVS video-frequency basic flow is done test analysis with the output of disk file form in real time.
Example below in conjunction with actual analysis illustrates actual analysis process of the present invention.
At first, import source code flow exaple.yuv simultaneously at input unit 100 input AVS code stream example.avs or example.ts..Example.avs wherein is an AVS video-frequency basic flow file, and example.ts is the video transmission stream file, and example.yuv is original YUV code stream.If that input is example.ts, then need the example.ts demultiplexing is extracted example.avs.
Code stream enters real time inspection analytic unit 110:
The analysis of example.avs code flow structure as shown in Figure 4.Open example.avs, read in data to buffering area.Read in bit stream data from buffering area, and judge whether code stream finishes.If do not finish, then the initial code of search sequence finds sequence head and parsing to export to the user, search the initial code of next initial code then for expansion and user data, therefore skip this segment encode stream, continue the next initial code of search, find the initial code of frame head.After having resolved frame head data, continue the search initial code, find the initial code of next initial code for expansion and user data information, therefore skip this segment encode stream, continue the next initial code of search, find the slice header initial code, resolve the band summary data, and the macro block data in the decoding band, each macro block data of circulation decoding, analyze the movable information and the summary info of macro block simultaneously, show that motion vector and macro block (mb) type (comprise INTRA, INTER, DIREC, COPY, P8x8 marks with different colours respectively).Circulation all macro blocks in the current band of decode continue to read in the initial code of information searching next one band, if after cycle analysis finishes all bands, continue the information of reading in, seek the initial code of next frame, behind interior all frames of the intact sequence of cycle analysis, continue the information of reading in, judge whether EOS.
Resolve in the above in each link of code stream, all will carry out the consistency checking of standard, whether check standard compliant grammatical and semantic.If the standard of not meeting then will give the alarm.Record TRACE daily record, error log and statistical information daily record when analyzing in the above.
Code stream enters daily record and checks analytic unit 120, checks the more detailed logging and the source code flow information of analytic unit 110 outputs respectively, and does statistical analysis, and the result exports to output unit 140.
For the repeatedly comparative analysis of retest and a plurality of code streams, can adopt batch processing analytic unit 130.From input unit 100 a plurality of video-frequency basic flows of input and original YUV files, perhaps the duplicate file of a basic stream is exported to the client with document form after the batch mode analysis.