How AVS2 Outperforms HEVC: Inside China’s Next‑Gen Video Codec
The article introduces China’s AVS2 video codec, detailing its standards, technical implementation, code extensions for FLV and HLS, bitstream structure, performance comparisons with HEVC and x265, and JD Cloud’s current support and future plans for commercial deployment.
Overview
AVS (Audio Video Coding Standard) workgroup was established in June 2002 to create a domestic Chinese audio‑video codec. Two generations (AVS, AVS2) have become national standards; AVS2’s compression efficiency is roughly twice that of AVS+ and H.264/AVC, and surpasses HEVC/H.265. AVS2 also supports 3‑D, multi‑view, VR, multi‑channel audio, surveillance video, and new media services for converged networks.
JD Cloud’s live‑streaming and on‑demand services are among the few public‑cloud providers in China that support AVS2.
Technical Implementation
AVS2 uses a hybrid coding framework that includes intra‑prediction, inter‑prediction, transform‑quantization, inverse processes, loop filtering and entropy coding. Compared with HEVC, AVS2’s quality loss relative to the source is 2.9 % versus 3.0 %. For 4K UHD video at the same bitrate, AVS2’s subjective quality is slightly higher than HEVC’s.
FLV AVS2 Extension
The FLV specification does not define an AVS2 CodecID. JD Video Cloud added a patch to FFmpeg that introduces CodecID 0xE and a sequence‑header definition for AVS2.
sequence_header() {
uint32_t profile_id; /* profile ID, davs2_profile_id_e */
uint32_t level_id; /* level ID */
uint32_t progressive; /* progressive sequence (0: interlace, 1: progressive) */
uint32_t width; /* image width */
uint32_t height; /* image height */
uint32_t chroma_format; /* chroma format (1: 4:2:0, 2: 4:2:2) */
uint32_t aspect_ratio; /* 2: 4:3, 3: 16:9 */
uint32_t low_delay; /* low delay */
uint32_t bitrate; /* bitrate (bps) */
uint32_t internal_bit_depth;/* internal sample bit depth */
uint32_t output_bit_depth; /* output sample bit depth */
uint32_t bytes_per_sample; /* bytes per sample */
float frame_rate; /* frame rate */
uint32_t frame_rate_id; /* frame rate code, mpeg12 [1...8] */
};For HLS, AVS2 adds stream_type = 0xD2 and stream_id = 0xE0.
AVS2 Bitstream Structure
The bitstream consists of start‑code‑delimited video sequences. Slice types include I, P, B, G, F, S, and GB.
slice type {
AVS2_I_SLICE = 0, /* I‑frame */
AVS2_P_SLICE = 1, /* P‑frame */
AVS2_B_SLICE = 2, /* B‑frame */
AVS2_G_SLICE = 3, /* G‑frame */
AVS2_F_SLICE = 4, /* F‑frame */
AVS2_S_SLICE = 5, /* S‑frame */
AVS2_GB_SLICE = 6, /* GB‑frame */
};
start code {
SC_SEQUENCE_HEADER = 0xB0,
SC_SEQUENCE_END = 0xB1,
SC_USER_DATA = 0xB2,
SC_INTRA_PICTURE = 0xB3,
SC_EXTENSION = 0xB5,
SC_INTER_PICTURE = 0xB6,
SC_VIDEO_EDIT_CODE = 0xB7,
SC_SLICE_CODE_MIN = 0x00,
SC_SLICE_CODE_MAX = 0x8F
};Video Sequence Example
video_sequence() {
do {
sequence_header();
extension_and_user_data(0);
do {
if (next_bits(32) == intra_picture_start_code)
intra_picture_header()
else
inter_picture_header()
extension_and_user_date(1)
picture_data()
} while (next_bits(32) == inter_picture_start_code() || next_bits(32) == intra_picture_start_code())
if (next_bits(32) == video_sequence_end_code)
video_sequence_end_code
if (net_bits(32) == video_edit_code)
video_edit_code
}
}In video‑on‑demand, AVS2 improves encoding efficiency, though FFmpeg still lacks container support for AVS in MKV/MP4.
Performance Comparison
At equal bitrate, AVS2’s encoding efficiency is about 10 %–30 % higher than x265, and its encoding speed can be 3–10 times faster at the same quality.
Subjective quality of AVS2 and HEVC is essentially identical under the same bitrate.
Future Outlook
JD Cloud will continue to optimize AVS series standards and promote commercial applications, aiming to reduce costs, improve user experience, and build scenario‑based video solutions in partnership with customers and ecosystem partners.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
JD Cloud Developers
JD Cloud Developers (Developer of JD Technology) is a JD Technology Group platform offering technical sharing and communication for AI, cloud computing, IoT and related developers. It publishes JD product technical information, industry content, and tech event news. Embrace technology and partner with developers to envision the future.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
