Personal View site logo
GH2 Maximum Variation Experiment
  • Attached is a variation of my 66M patch taking a completely different approach.

    So far most patches have attempted (deliberately, or not) to achieve a fairly high constant bitrate. In other words - bitrate has been king. This patch takes an entirely different approach. In this patch measured quality is king, and bitrate use and buffering is allowed to vary.

    The basic architecture of a VBR H.246 codec is to set up boundaries for min/max bitrate and QP settings. As a frame is encoded a range of QP (quality) values are attempted for each macroblock. The searching stops under one of two circumstances - either the macroblock reaches a quality level within the number of bits allocated for it, or the quality is degraded until the allocated bits are not exceeded. The problem with this is that the codec isn't perfect, so it may degrade the image somewhat before the frame is finished as all this is estimated, and few higher QP values are attempted.

    This patch allows many more QP settings to be attempted for each I frame. Thus if a desired quality level is reached with a higher QP value it will be used and bandwidth is made available for later macroblocks that may need it more. The best way I can put it is that this patch does more to use actual measured quality rather than theoretical quality.

    I've done some testing - but I would like additional input. Unfortunately, spanning is still an issue. This is pretty experimental at this point, so don't rely on this patch yet.

    Chris
  • 60 Replies sorted by
  • I'll put this to work in my GH2 and see what transpires....I'll post when I have feedback, thank you.
    Should I be adjusting parameters or use as you've posted?
  • The AQ parameters are currently set to AQ2. It might be worth testing AQ4 to see if that works well.

    Chris
  • Thanks Chris, looking foward to checking this out.
  • @cbrandin Looks interesting. Let's see what Chris has been up to...!
  • @cbrandin You're not touching FB1s then? Lifting the FB2s for more QP movement?
  • @driftwood

    Nope - the other way around - sort of. I'm setting the FB1 settings to their factory defaults, which allows for higher QP values to be tried. The FB2 settings are set close to what they are automatically set to when you set bitrate - which determines the lowest QP (highest quality) settings. It's more work for the CPU, but I think it's up to it. Basically, with 66M settings, it allows macroblock QP values to be in the range of 13-26 instead of 13-17, or there abouts. That's for 24H settings, others are proportionally higher.

    Chris
  • that's inspiring development in a new scientific direction, look forward to test it, thank you @cbrandin
  • @cbrandin Yep, many thanks. I follow the logic of this and it should give us the best of all worlds. Been shooting with it on AQ3 for the last 3 hours or more and all seems stable. Its difficult to tell the improvements it gives, but following the logic I used a really shallow DOF on my kid eating (lots of motion there, she's 6 months and weaning). I figure that it would be using a lower QP on the background which would free up more bandwidth to be used for the foreground and motion. Average bitrate was only about 44M, which I guess is a good thing as the previous patch would probably have created identical results at AQ3 but would have run at a much higher average (is this correct ?). It looks very good but it's not a scientific test.
    Shooting heavy motion and detail (trees in a strong wind) I cannot see a difference in the quality of the motion rendering with this patch at either AQ2 or AQ3 (will try AQ4 later). Both AQ2 and AQ3 produced nigh on identical average bitrates, which I guess points to the fact it probably settled on similar values for both shots (as the detail is so high). All good stuff so far.

    Do you know what would be the QP range running this at AQ3 ?
  • Ok downloaded, i will make a couple of test with my new Leica 45mm Macro.
  • Interesting stuff. In fact, it immediately makes me want to try it out, but I have a 48 Hour Film contest this weekend and the last thing I want to do is full in love with settings that might not be stable!
  • Is it possible to get that patch with a higher bitrate for 720p50/60? I would like something around 45mb...
  • @cbrandin have you a version of your original 44M AQ4 and 66M AQ2 that uses the smaller FBs and Framelimit, now it seems that a bitrate multiple isn't required ? Or are we finding through testing this setting a better approach to patching altogether (as in letting the codec do the work of managing the allocation of the available bandwidth, instead of limiting it to a small range of QPs) ?
  • @cbrandin It looks stable on the charts Chris. We're gonna need some YUV comparisons - Ralph?
  • @cbrandin
    For high-bitrate settings, do you think it may be effective to set a cap on the maximum QP value the encoder will use on the lowest quality macroblocks? At 75Mbps with the pro version of MainConcept's H.264 encoder, I've seen some improvement in shadow detail by lowering the max QP from 51 to 32. Is there a patch in PTools that sets max QP?
  • @LPowell no. I attempted this. You can try Initial Q to say 18 and then Q to any higher setting to attempt a range. But generally, Ive seen most of the macroblocks return +- 2 Q of the Q setttings. Give it a try.
  • @cbrandin

    can you make same for the 44 mbps version ?
    please .ini
    Thank you
  • @feha

    Here is the 44M version of the experimental patch.

    Chris
    setf.zip
    516B
  • @nic2011

    So far I have not been able to increase the 50/60p settings more without instability.

    Chris
  • @LPowell

    The point of this experimantal patch is to allow the codec to use higher QP values if it can and still maintain quality - sort of the opposite of what you are suggesting. You really don't want to restrict the range more than the default - which is a range of target QP-2 to target QP+2. What happens if a frame runs out of bandwidth is that a fallback Quantizer scaling matrix is used to lower bitrate instead - and that looks terrible (severe macroblocking in lower parts of the frame). The 66M patch allows for a range of target QP-2 to target QP+10 (approximately).

    Chris
  • @cbrandin
    >>So far I have not been able to increase the 50/60p settings more without instability.>>

    Too bad! I´d really appreciate such a patch with a higher bitrate (45-50) for 720p50/60...
  • I'll run HDMI comparison tests as soon as I can, but very busy right now...
  • @cbrandin here's the 66M death chart FYI. Looks good but could be some cadence issues as u can see. Test was conducted on 14-140 lens on a tripod, nearly 3 mins, 125 shutter at 800 iso.
    cbrandin 66M 'QP maximum variation' - pappas death chart result.png
    1678 x 696 - 56K
  • @driftwood

    Thanks for the test. Any movement or light changes during the test? What focus mode was the camera set to? Was OIS on or off?

    Chris
  • @cbrandin OIS on. Lights fully up in room. just left it going (unattended no moving around it) for 3 mins. Ill try any tests you want. Let me know. 44M Coming up in 5 mins.

    Ill do two OIS off shortly - one for 66 and one for your 44m setting.
  • @cbrandin 44M tests on 0x2400000 video buffer: tripod, Pappas Death Chart, unattended for 3 mins both tests.
    Chart 1: OIS on 14-140 lens, 125 Shutter/800ISO Well Lit Room.
    Chart 2: OIS off 14-140 lens, 125 Shutter/800ISO Well Lit Room. No movement whatsoever/no light change/ I can send you the mts file for proof. But its weird what happens at frame 3630 onwards - the picture does NOT change I watched it continuosly with streamparser.
    Note: Focus mode on all tests set to 25 (giving 50mm!!!)

    Overall, I think things are fine.
    cbrandin 44M 'QP maximum variation' - 14-140 lens OIS on - pappas death chart result.png
    1683 x 833 - 194K
    cbrandin 44M 'QP maximum variation' - 14-140 lens OIS off - pappas death chart result.png
    1679 x 775 - 103K