3 Replies Latest reply: May 9, 2013 3:18 PM by Rallymax-forum RSS

    H.264 All-Intra Data Rates Significantly Higher

    Profitic Community Member

      Does the built-in H.264 codec encode I-frame only files differently? I am trying to determine the optimal GOP length for high bitrate exports. Image quality seems to degrade, even in the I-frames, when using key frame distances greater than one.

       

      After performing a series of tests to characterize the Adobe H.264 encoder, I discovered that exported files are significantly larger when key frame distance equals one frame (N=1). The average video data rate for a test file rendered with the Adobe H.264 encoder is as follows:

       

      N=1 : 2.17 bpp : 24I

      N=2 : 0.66 bpp : 12I + 12P

      N=3 : 0.59 bpp : 8I + 8B + 8P

       

      Note how the data rate drops 70% (from 2.17 to 0.66 bpp) even though 50% of the I-frames still exist when N=2. By comparison, here is the video data rate when exporting with QuickTime H.264:

       

      N=1 : 0.89 bpp : 24I

      N=2 : 0.70 bpp : 12I + 12P

      N=3 : 0.64 bpp : 8I + 16P

       

      The following chart shows data rates at key frame distances from 1-48 frames for Adobe H.264, QuickTime H.264 (via Adobe), QuickTime Pro, and Expression Encoder 4 Pro. Data rates are consistent among all encoders at GOP lengths greater than one. There is an anomoly with the Adobe H.264 codec compressing all-intra files.

      H264_Compression_1a.png

       

      The observed behavior occurs in all profiles, which were tested at Levels 4.1, 4.2, 5.0, and 5.1:

      H264_Compression_2a.png

       

      Image quality is better in the Adobe H.264 all-intraframe file, especially with respect to detail retention. The pictures below show sections of two consecutive frames magnified 400%. The file with N=2 is less accurate and contains noticeable blocking. Even the I-frames don't look as good in the files where N>1.

      H264_Compression_3.png

       

      The test file was a seventeen second Premiere Pro sequence consisting of H.264, MPEG-2, and AE files with effects applied. Exports were rendered from the Premiere Pro timeline and from a V210 uncompressed 4:2:2 intermediate file of the sequence. The following settings were used:

       

      Format: H.264

      Width: 1280

      Height: 720

      Frame Rate: 24 fps

      Field Order: Progressive

      Aspect: Square Pixels (1.0)

      TV Standard: NTSC

      Profile: Baseline, Main, and High

      Levels: 4.1, 4.2, 5.0, 5.1

      Render at Maximum Bit Depth: Enabled

      Bitrate Encoding: VBR, 2-Pass

      Target Bitrate: Maximized for each Profile/Level

      Maximum Bitrate: Maximized for each Profile/Level

      Key Frame Distance: 1, 2, 3, 4, 5, 6, 7, 8, 12, 24, 48

      Use Maximum Render Quality: Enabled

      Multiplexer: MP4

      Stream Capability: Standard

       

      Software:

       

      Adobe Media Encoder CS6 Creative Cloud v6.0.3.1 (64-bit)

      Premiere Pro CS6 Creative Cloud v6.0.3

      Windows 7 SP1

      QuickTime Pro for Windows v7.6.9 (1680.9)

      MediaInfo 0.7.62 (for GOP and data rate information)

        • 1. Re: H.264 All-Intra Data Rates Significantly Higher
          Rallymax-forum Community Member

          I think the short answer is yes,

          a h.264 encoder does I-frame only differently. I frames are complete expressions of a picture with no temporal compression information.

          P frames use _P_redictive information. IE information from prior frames.

          B frames use _B_i-directional predictive frame information.

           

          h.264 gets the majority of it's bit saving from use of B and P frames. When you do I-frame only you only get the block compression and none of the advantages of P and B frames. Thus the GOP N=1 doesn't get very good bit's per pixel.

           

          Having said all that I do find your comment...

          Profitic wrote:

           

          Note how the data rate drops 70% (from 2.17 to 0.66 bpp) even though 50% of the I-frames still exist when N=2. By comparison, here is the video data rate when exporting with QuickTime H.264:

           

          ... very interesting. Indeed, why is the datarate 70% less when it should at best be 50% for GOP N=2. 50% less should be the same I-frame information plus 0 bytes for the B frame between them. (GOP = I,B,I). Any more than that and it is throwing away bits from the I-frame. So, this seems to be to be a ratecontrol bug.

           

           

          http://en.wikipedia.org/wiki/Group_of_pictures

           

          "The GOP structure is often referred by two numbers, for example, M=3, N=12. The first number tells the distance between two anchor frames (I or P): it is the GOP size. The second one tells the distance between two full images (I-frames): it is the GOP length. For the example M=3, N=12, the GOP structure is IBBPBBPBBPBBI. Instead of the M parameter the maximal count of B-frames between two consecutive anchor frames can be used."

          • 2. Re: H.264 All-Intra Data Rates Significantly Higher
            Profitic Community Member

            Thank you for the reply. Perhaps the question in the original post should have been worded differently; I am trying to verify and understand any changes to I-frame encoding parameters when N=1 versus N>1.

            • 3. Re: H.264 All-Intra Data Rates Significantly Higher
              Rallymax-forum Community Member

              I seriously doubt you'll get anything that detailed in this public forum.

              Further, even if you were to open a dialog with Adobe directly, I doubt they would have the information to share if they wanted too since they use a 3rd party h.264 encoder SDK.

              it definitely seems like a bug in the rate control code of the Main Concept h.264 SDK.