JD Cloud Video Cloud Fully Supports the AVS2 Standard

  • JDT Developer
  • 2022-01-05
  • IP归属:未知
  • 186 browse

    I. Overview

     

    The Audio and Video Coding Standard (AVS) Working Group was established in June 2002 with the approval of the Department of Science and Technology of the former Ministry of Information Industry, aiming at developing audio and video coding standard for China. Up to now, two generations of AVS have been officially released and become the national standard. At present, the third generation – AVS3 – is under development. AVS2 refers to the second generation of AVS. Tests have shown that the compression efficiency of AVS2 is twice as high as that of AVS+ and H.264/AVC, and exceeds that of HEVC/H.265 (international counterpart). AVS2 also supports efficient coding of 3D video, multi-view and virtual reality video, efficient lossy and lossless coding of stereo and multi-channel audio, efficient coding of surveillance video, and new media services for three-network convergence, etc.

    With the deep cultivation and accumulation in the field of video coding, JD Cloud’s Live Video / VOD products can all support AVS2, making JD Cloud one of the few public cloud manufacturers in China that support AVS2.

    II. Technological Implementation

     
    AVS2 adopts a hybrid coding framework, and the whole coding process includes the modules of intra-frame prediction, inter-frame prediction, transformation and quantization, inverse quantization and inverse transformation, loop filtering and entropy coding. AVS2 and HEVC reduce the quality of the source image by 2.9% and 3.0% respectively. For UHD 4K video, AVS2 has slightly better average subjective quality than HEVC at the same code rate.
    avs1.jpg
    Basic Process of Pushing and Pulling Streaming


    Notes to extension of FLV AVS2:


    The FLV specification does not support AVS2, and FFmpeg has no defined support for CodecID, AVS2 coding and decoding algorithm of FLV. JD Video Cloud added ffmpeg to support the encapsulation/decapsulation of AVS2 patches, optimized some columns, added CodecID of AVS2 as 0×E, and the definition of AVS2 sequence header.


    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] */
    };


    avs2.jpg

    Example of FLV AVS2 Extension

    Notes to extension of HLS AVS2:

    TS added stream_type=0×D2, stream_id=0×E0 of AVS2

    avs3.jpg

    avs4.jpg


    AVS2 stream structure:图片

    The code stream structure of AVS2 is composed of a video sequence including start coded. And there are six slice types for the video frame, including I, P, and B, as shown below:


    slice type {
        AVS2_I_SLICE = 0,           /* slice type: I frame */
        AVS2_P_SLICE = 1,           /* slice type: P frame */
        AVS2_B_SLICE = 2,           /* slice type: B frame */
        AVS2_G_SLICE = 3,           /* AVS2 type:  G frame */
        AVS2_F_SLICE = 4,           /* slice type: F frame */
        AVS2_S_SLICE = 5,           /* AVS2 type:  S frame */
        AVS2_GB_SLICE = 6,          /* AVS2 type:  GB frame*/
    };
    start code {
        SC_SEQUENCE_HEADER = 0xB0,  /* sequence header start code */
        SC_SEQUENCE_END    = 0xB1,  /* sequence end    start code */
        SC_USER_DATA       = 0xB2,  /* user data       start code */
        SC_INTRA_PICTURE   = 0xB3,  /* intra picture   start code */
        SC_EXTENSION       = 0xB5,  /* extension       start code */
        SC_INTER_PICTURE   = 0xB6,  /* inter picture   start code */
        SC_VIDEO_EDIT_CODE = 0xB7,  /* video edit      start code */
        SC_SLICE_CODE_MIN  = 0x00,  /* min slice       start code */
        SC_SLICE_CODE_MAX  = 0x8F   /* max slice       start code */
    };


    avs5.jpg
    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 terms of VOD, AVS2 can effectively improve the encoding efficiency. FFmpeg does not support AVS container formats such as MKV/MP4. At present, in terms of video processing, JD Cloud VOD already supports media processing such as AVS2-related transcoding.


    Comparison of Mainstream Coding Rates


    avs6.jpg


    At the same encoding rate, AVS2 is about 10%-30% higher than ×265. At the same encoding efficiency, AVS2 is 3-10 times faster than ×265.


    Average Subjective Quality of AVS2 V.s. HEVC


    avs7.jpg


    At the same code rate, the average subjective quality of AVS2 and HEVC was basically the same.



    III. AVS2 Coding Effect


    avs8.jpg


    In the future, JD Cloud’s Video Cloud will continue to promote the in-depth optimization and commercial application of AVS series and other video-related standards, so as to reduce costs and increase efficiency for customers and improve user experience, and strive to create scenario-based solutions around video, in a bid to establish deeper cooperation with customers and ecological partners.



    number of articles
    544
    reading volume
    3296738