- Green versionCheck
- Green versionCheck
- Green versionCheck
XviD is a PC video codec, and codec is the abbreviation for [Cooperation], and therefore describes a scheme to digital video encoding and decoding of encoded video data with the purpose of reducing traffic, which means that It is smaller and faster for more efficient storage transfer over a computer network or on a computer disk.
Xvid has two encoding methods: single pass and twopass
The single pass mode is simple to code and fast, but the final effect is not as good as two pass.
Twopass means that video compression needs to be encoded twice, namely twopass-1st pass (referred to as 1pass) and twopass-2nd pass (referred to as 2pass).
In 1 pass, the encoder will use the highest quality encoding to collect picture information that can be used as a reference for the second operation, and in 2 pass. The encoder will automatically allocate bit rates based on the information obtained from the first compression and the file size specified by the user, so that moving pictures that require high traffic will be allocated more space and a higher bit rate to ensure picture quality. In contrast, a lower bit rate is used for static images that do not contain much motion information. Friends who pursue image quality will certainly choose this method, but the calculation is more time-consuming than single pass.
Next, some basic concepts are introduced:
Q value - quantization value, which is used to describe the quality of a frame. Each frame has a Q value, ranging from 1 to 31. The smaller the Q value, the better the image quality and the higher the bit rate.
I-frame - key frame, often abbreviated as IF. A key frame is the first frame that makes up a frame group. IF retains all information of a scene
P-frame - future single prediction frame, abbreviated as PF, only stores the difference from the previous decompressed picture
B-frame - bidirectional prediction frame, abbreviated as BF, in addition to referring to the previously decompressed picture, it will also refer to the picture information of the next frame
Coding process:
Settings of each variable: Create xvid_enc_frame_t and xvid_enc_stats_t, which are used to pass in parameters and statistical encoding results respectively.
Specific process:
Set the incoming image data and image color space
Set the outgoing code stream
Set the flag of vol
Set the encoding type of the frame
Set quantization factor
Set motion estimation algorithm collection
Set vop flag
Functions provided by the encoder
it works
it works
it works