Author Topic: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.  (Read 13851 times)

Marvin

  • New to the forum
  • *
  • Posts: 31
  • Personality is destiny
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #25 on: February 13, 2013, 06:34:59 PM »
Hmm... is it 4:2:2 though? they co-designed with ti  so they could have solved some of the regular encoder's problems. They renamed the parameters slightly already. Have to look inside to see.

Only 4K is JPEG 8bit 4:2:2, H264 is the same options as 5D3, plus 50p/60p mode and s35 mode.
Film is truth 24 frames per second.

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #26 on: April 15, 2013, 05:44:46 PM »
Since I can now analyze files:

Transform8x8Flag=
0 - 16x16 only
1 - 8x8 only
2 - Auto 8x8,16x16, sometimes 4x4

Is there a benefit to having pmode be 8x8 all the time? Messing with 4x4 matrices seems to produce broken files or in mode 3 seems to set 8x8flag to 0 more.

So 1 I see 8x8 and 16x16 P mode and so far no 4x4 p-mode. 8x8 flag on all frames.

2 I see all but transform flag is only on some frames.

the 4x4 pops up like this

Code: [Select]
position             : 112x0
slice_id             : 1
mb_addr              : 112
size (in bits)       : 362
tr, pr, mv size      : 346, 15, 0
mb_type              : Intra  0 (I_4x4)
transform_8x8        : 0
field\frame          : frame
cbp bits             : 0 1101 1 11 0 00
                     :   0111   01   00
                     :   1111
                     :   0101
quant_param          : 1
pmode                : Intra_4x4
ipred Intra_4x4      :
 DC           DC           DC           DC         
 Vert         Vert         Vert         Vert       
 Vert         Vert         Vert         Vert       
 Vert         DC           Vert         Vert       
ipred chroma         : DC

Are they worth using vs 8x8 flag on everything?

driftwood

  • Freshman
  • **
  • Posts: 70
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #27 on: April 15, 2013, 10:16:36 PM »
We need the ability to utilise both 8x8 and 4x4 transform - the finer 4x4 sub blocks consume more memory but when enabled along with 8x8 tend only to be used on strong changes in luma variance (like highlights and vert/horiz lines - edge detection) - the majority of the picture in h264 will be encoded in 8x8. Therefore I suggest to leave Transform8x8Flag=2 (Auto) alone.

When switching on the SIX '0' to '5' 4x4 scaling matrices; have you a way of user-entry (hex) into the sixteen '00' to '15' numbered slots yet? Also have you discovered a way of switching on and edit/entry of the two 8x8s [7] and [8]

I wish I had a 5DMKIII to play with - Id resolve a few of the problems pretty quickly. :-)

Here's a hex version of my GH2 moon setting for the 4x4s (note I have not included the special 'Fallback' matrix which kicks in when the encoder runs out of memory/buffer.

1080p24 Scaling I=0x706, 0xD0A, 0xD0A, 0x140D, 0x130C, 0x140D, 0x1912, 0x1913, 0x1912, 0x1912, 0x241A, 0x2424, 0x241A, 0x2624, 0x2624, 0x2626, 0x706, 0x1210, 0x1210, 0x201E, 0x1F17, 0x201E, 0x3030, 0x3030, 0x3030, 0x3030, 0x7F48, 0x7F48, 0x7F48, 0x7F7F, 0x7F7F, 0x7F7F, 0x706, 0x1210, 0x1210, 0x201E, 0x1F17, 0x201E, 0x3030, 0x3030, 0x3030, 0x3030, 0x7F48, 0x7F48, 0x7F48, 0x7F7F, 0x7F7F, 0x7F7F
1080p24 Scaling P=0x907, 0x1E16, 0x1E16, 0x2824, 0x2820, 0x2816, 0x4B24, 0x4B39, 0x4B4E, 0x4B57, 0x729C, 0x7266, 0x7248, 0xC090, 0xC0FF, 0xFFFF, 0x906, 0x4C24, 0x4C24, 0x7854, 0x684B, 0x7854, 0x7FE4, 0x7FE4, 0x7FE4, 0x7FE4, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x906, 0x4C24, 0x4C24, 0x7854, 0x684B, 0x7854, 0x7FE4, 0x7FE4, 0x7FE4, 0x7FE4, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF
1080p24 Scaling B=0xC08,0x120A,0x120A,0x2414,0x180E,0x2414,0x3818,0x3820,0x3820,0x3818,0x4038,0x526C,0x4038,0x6C7F,0x6C7F,0x6C7F, 0x905, 0xD0A, 0xD0A,0x1419,0x120F,0x1419,0x4850,0x4850,0x4850,0x4850,0x546C,0x546C,0x546C,0x608C,0x608C,0x6CB0, 0x905, 0xD0A, 0xD0A,0x1419,0x120F,0x1419,0x4850,0x4850,0x4850,0x4850,0x546C,0x546C,0x546C,0x608C,0x608C,0x6CB0


Note that these matrices are condensed as two of the 6 matrices are identical - I think (in the pps or sps) you'll find Intra scaling_matrix(2) is the same as (1) and Inter scaling_matrix (5) is the same as (4) so you only need to design/devise entry for four scaler tables for each of the three IPB frame types entry - as in to produce Intra Y (0) Inter Y (3), Intra Cb/r (1) and Inter Cb/r (4).


--------- Profiles -----
Level = 51 currently (default) This allows Adaptive 8x8 transform. If it were =40 (level 4) it would probably force the encoder into using 4x4 transform. Give it a try. However, the numbr of macro blocks allowed (and size) will fall.
Canon 60D, Canon 5DMK3, Lexar 1000x 128GB CF, Panasonic (shhhh!) GH2s & GH3s. :-)

driftwood

  • Freshman
  • **
  • Posts: 70
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #28 on: April 15, 2013, 11:00:14 PM »
Here's an SPS (sequence Parameter Set) ripped from the new Panasonic GH3's 24p All-I mode (note the Profile is High Level 50 (5);-


  [00]seq_parameter_set_rbsp() {
    profile_idc                                    = 100 (High)
    constraint_set0_flag                           = 0 (false)
    constraint_set1_flag                           = 0 (false)
    constraint_set2_flag                           = 0 (false)
    constraint_set3_flag                           = 0 (false)
    reserved_zero_4bits                            = 0 (false)
    level_idc                                      = 50
    seq_parameter_set_id                           = 0
    if (profile_idc == 100 || profile_idc == 110 || profile_idc == 122 || profile_idc == 144) {
      chroma_format_idc                            = 1 (4:2:0)
      if (chroma_format_idc == 3)
        residual_colour_transform_flag             = na
      bit_depth_luma_minus8                        = 0 (8)
      bit_depth_chroma_minus8                      = 0 (8)
      qpprime_y_zero_transform_bypass_flag         = 0 (false)
      seq_scaling_matrix_present_flag              = 1 (true)
      if (seq_scaling_matrix_present_flag)
        for (i = 0; i < 8; i++) {
          seq_scaling_list_present_flag[0]         = 1 (true)
          if (seq_scaling_list_present_flag[0])
            scaling_list_4x4[00]                   = 6
            scaling_list_4x4[01]                   = 10
            scaling_list_4x4[02]                   = 14
            scaling_list_4x4[03]                   = 18
            scaling_list_4x4[04]                   = 10
            scaling_list_4x4[05]                   = 13
            scaling_list_4x4[06]                   = 17
            scaling_list_4x4[07]                   = 36
            scaling_list_4x4[08]                   = 13
            scaling_list_4x4[09]                   = 16
            scaling_list_4x4[10]                   = 34
            scaling_list_4x4[11]                   = 96
            scaling_list_4x4[12]                   = 16
            scaling_list_4x4[13]                   = 32
            scaling_list_4x4[14]                   = 72
            scaling_list_4x4[15]                   = 127
          seq_scaling_list_present_flag[1]         = 1 (true)
          if (seq_scaling_list_present_flag[1])
            scaling_list_4x4[00]                   = 6
            scaling_list_4x4[01]                   = 16
            scaling_list_4x4[02]                   = 30
            scaling_list_4x4[03]                   = 48
            scaling_list_4x4[04]                   = 16
            scaling_list_4x4[05]                   = 24
            scaling_list_4x4[06]                   = 48
            scaling_list_4x4[07]                   = 72
            scaling_list_4x4[08]                   = 30
            scaling_list_4x4[09]                   = 48
            scaling_list_4x4[10]                   = 72
            scaling_list_4x4[11]                   = 127
            scaling_list_4x4[12]                   = 48
            scaling_list_4x4[13]                   = 72
            scaling_list_4x4[14]                   = 127
            scaling_list_4x4[15]                   = 127
          seq_scaling_list_present_flag[2]         = 1 (true)
          if (seq_scaling_list_present_flag[2])
            scaling_list_4x4[00]                   = 6
            scaling_list_4x4[01]                   = 16
            scaling_list_4x4[02]                   = 30
            scaling_list_4x4[03]                   = 48
            scaling_list_4x4[04]                   = 16
            scaling_list_4x4[05]                   = 24
            scaling_list_4x4[06]                   = 48
            scaling_list_4x4[07]                   = 72
            scaling_list_4x4[08]                   = 30
            scaling_list_4x4[09]                   = 48
            scaling_list_4x4[10]                   = 72
            scaling_list_4x4[11]                   = 127
            scaling_list_4x4[12]                   = 48
            scaling_list_4x4[13]                   = 72
            scaling_list_4x4[14]                   = 127
            scaling_list_4x4[15]                   = 127
          seq_scaling_list_present_flag[3]         = 1 (true)
          if (seq_scaling_list_present_flag[3])
            scaling_list_4x4[00]                   = 9
            scaling_list_4x4[01]                   = 15
            scaling_list_4x4[02]                   = 20
            scaling_list_4x4[03]                   = 25
            scaling_list_4x4[04]                   = 15
            scaling_list_4x4[05]                   = 20
            scaling_list_4x4[06]                   = 25
            scaling_list_4x4[07]                   = 36
            scaling_list_4x4[08]                   = 20
            scaling_list_4x4[09]                   = 25
            scaling_list_4x4[10]                   = 36
            scaling_list_4x4[11]                   = 96
            scaling_list_4x4[12]                   = 25
            scaling_list_4x4[13]                   = 36
            scaling_list_4x4[14]                   = 96
            scaling_list_4x4[15]                   = 127
          seq_scaling_list_present_flag[4]         = 1 (true)
          if (seq_scaling_list_present_flag[4])
            scaling_list_4x4[00]                   = 16
            scaling_list_4x4[01]                   = 32
            scaling_list_4x4[02]                   = 52
            scaling_list_4x4[03]                   = 74
            scaling_list_4x4[04]                   = 32
            scaling_list_4x4[05]                   = 46
            scaling_list_4x4[06]                   = 74
            scaling_list_4x4[07]                   = 127
            scaling_list_4x4[08]                   = 52
            scaling_list_4x4[09]                   = 74
            scaling_list_4x4[10]                   = 127
            scaling_list_4x4[11]                   = 127
            scaling_list_4x4[12]                   = 74
            scaling_list_4x4[13]                   = 127
            scaling_list_4x4[14]                   = 127
            scaling_list_4x4[15]                   = 127
          seq_scaling_list_present_flag[5]         = 1 (true)
          if (seq_scaling_list_present_flag[5])
            scaling_list_4x4[00]                   = 16
            scaling_list_4x4[01]                   = 32
            scaling_list_4x4[02]                   = 52
            scaling_list_4x4[03]                   = 74
            scaling_list_4x4[04]                   = 32
            scaling_list_4x4[05]                   = 46
            scaling_list_4x4[06]                   = 74
            scaling_list_4x4[07]                   = 127
            scaling_list_4x4[08]                   = 52
            scaling_list_4x4[09]                   = 74
            scaling_list_4x4[10]                   = 127
            scaling_list_4x4[11]                   = 127
            scaling_list_4x4[12]                   = 74
            scaling_list_4x4[13]                   = 127
            scaling_list_4x4[14]                   = 127
            scaling_list_4x4[15]                   = 127
          seq_scaling_list_present_flag[6]         = 1 (true)
          if (seq_scaling_list_present_flag[6])
            scaling_list_8x8[00]                   = 6
            scaling_list_8x8[01]                   = 8
            scaling_list_8x8[02]                   = 10
            scaling_list_8x8[03]                   = 12
            scaling_list_8x8[04]                   = 14
            scaling_list_8x8[05]                   = 16
            scaling_list_8x8[06]                   = 19
            scaling_list_8x8[07]                   = 22
            scaling_list_8x8[08]                   = 8
            scaling_list_8x8[09]                   = 10
            scaling_list_8x8[10]                   = 12
            scaling_list_8x8[11]                   = 14
            scaling_list_8x8[12]                   = 16
            scaling_list_8x8[13]                   = 19
            scaling_list_8x8[14]                   = 22
            scaling_list_8x8[15]                   = 28
            scaling_list_8x8[16]                   = 10
            scaling_list_8x8[17]                   = 12
            scaling_list_8x8[18]                   = 14
            scaling_list_8x8[19]                   = 16
            scaling_list_8x8[20]                   = 19
            scaling_list_8x8[21]                   = 22
            scaling_list_8x8[22]                   = 28
            scaling_list_8x8[23]                   = 36
            scaling_list_8x8[24]                   = 12
            scaling_list_8x8[25]                   = 13
            scaling_list_8x8[26]                   = 15
            scaling_list_8x8[27]                   = 19
            scaling_list_8x8[28]                   = 22
            scaling_list_8x8[29]                   = 32
            scaling_list_8x8[30]                   = 42
            scaling_list_8x8[31]                   = 64
            scaling_list_8x8[32]                   = 13
            scaling_list_8x8[33]                   = 14
            scaling_list_8x8[34]                   = 18
            scaling_list_8x8[35]                   = 21
            scaling_list_8x8[36]                   = 32
            scaling_list_8x8[37]                   = 48
            scaling_list_8x8[38]                   = 96
            scaling_list_8x8[39]                   = 96
            scaling_list_8x8[40]                   = 14
            scaling_list_8x8[41]                   = 17
            scaling_list_8x8[42]                   = 20
            scaling_list_8x8[43]                   = 28
            scaling_list_8x8[44]                   = 42
            scaling_list_8x8[45]                   = 96
            scaling_list_8x8[46]                   = 127
            scaling_list_8x8[47]                   = 127
            scaling_list_8x8[48]                   = 16
            scaling_list_8x8[49]                   = 19
            scaling_list_8x8[50]                   = 24
            scaling_list_8x8[51]                   = 36
            scaling_list_8x8[52]                   = 64
            scaling_list_8x8[53]                   = 96
            scaling_list_8x8[54]                   = 127
            scaling_list_8x8[55]                   = 127
            scaling_list_8x8[56]                   = 18
            scaling_list_8x8[57]                   = 22
            scaling_list_8x8[58]                   = 30
            scaling_list_8x8[59]                   = 42
            scaling_list_8x8[60]                   = 64
            scaling_list_8x8[61]                   = 96
            scaling_list_8x8[62]                   = 127
            scaling_list_8x8[63]                   = 127
          seq_scaling_list_present_flag[7]         = 1 (true)
          if (seq_scaling_list_present_flag[7])
            scaling_list_8x8[00]                   = 9
            scaling_list_8x8[01]                   = 13
            scaling_list_8x8[02]                   = 15
            scaling_list_8x8[03]                   = 17
            scaling_list_8x8[04]                   = 19
            scaling_list_8x8[05]                   = 21
            scaling_list_8x8[06]                   = 23
            scaling_list_8x8[07]                   = 25
            scaling_list_8x8[08]                   = 13
            scaling_list_8x8[09]                   = 14
            scaling_list_8x8[10]                   = 17
            scaling_list_8x8[11]                   = 19
            scaling_list_8x8[12]                   = 21
            scaling_list_8x8[13]                   = 23
            scaling_list_8x8[14]                   = 25
            scaling_list_8x8[15]                   = 28
            scaling_list_8x8[16]                   = 15
            scaling_list_8x8[17]                   = 17
            scaling_list_8x8[18]                   = 19
            scaling_list_8x8[19]                   = 22
            scaling_list_8x8[20]                   = 24
            scaling_list_8x8[21]                   = 26
            scaling_list_8x8[22]                   = 28
            scaling_list_8x8[23]                   = 32
            scaling_list_8x8[24]                   = 17
            scaling_list_8x8[25]                   = 19
            scaling_list_8x8[26]                   = 22
            scaling_list_8x8[27]                   = 24
            scaling_list_8x8[28]                   = 27
            scaling_list_8x8[29]                   = 32
            scaling_list_8x8[30]                   = 48
            scaling_list_8x8[31]                   = 64
            scaling_list_8x8[32]                   = 19
            scaling_list_8x8[33]                   = 21
            scaling_list_8x8[34]                   = 24
            scaling_list_8x8[35]                   = 27
            scaling_list_8x8[36]                   = 32
            scaling_list_8x8[37]                   = 64
            scaling_list_8x8[38]                   = 96
            scaling_list_8x8[39]                   = 127
            scaling_list_8x8[40]                   = 21
            scaling_list_8x8[41]                   = 23
            scaling_list_8x8[42]                   = 26
            scaling_list_8x8[43]                   = 32
            scaling_list_8x8[44]                   = 64
            scaling_list_8x8[45]                   = 96
            scaling_list_8x8[46]                   = 127
            scaling_list_8x8[47]                   = 127
            scaling_list_8x8[48]                   = 23
            scaling_list_8x8[49]                   = 25
            scaling_list_8x8[50]                   = 28
            scaling_list_8x8[51]                   = 48
            scaling_list_8x8[52]                   = 96
            scaling_list_8x8[53]                   = 127
            scaling_list_8x8[54]                   = 127
            scaling_list_8x8[55]                   = 127
            scaling_list_8x8[56]                   = 25
            scaling_list_8x8[57]                   = 28
            scaling_list_8x8[58]                   = 32
            scaling_list_8x8[59]                   = 64
            scaling_list_8x8[60]                   = 127
            scaling_list_8x8[61]                   = 127
            scaling_list_8x8[62]                   = 127
            scaling_list_8x8[63]                   = 127
          }
        }
      }
    log2_max_frame_num_minus4                      = 0 (4)
    pic_order_cnt_type                             = 0
    if (pic_order_cnt_type == 0)
      log2_max_pic_order_cnt_lsb_minus4            = 0 (4)
    else if (pic_order_cnt_type == 1) {
      delta_pic_order_always_zero_flag             = na
      offset_for_non_ref_pic                       = na
      offset_for_top_to_bottom_field               = na
      num_ref_frames_in_pic_order_cnt_cycle        = na
      for(i = 0; i < num_ref_frames_in_pic_order_cnt_cycle; i++)
      }
    num_ref_frames                                 = 2
    gaps_in_frame_num_value_allowed_flag           = 0
    pic_width_in_mbs_minus1                        = 119 (1920)
    pic_height_in_map_units_minus1                 = 67 (1088)
    frame_mbs_only_flag                            = 1
    if (!frame_mbs_only_flag)
      mb_adaptive_frame_field_flag                 = na
    direct_8x8_inference_flag                      = 1 (true)
    frame_cropping_flag                            = 1 (true)
    if (frame_cropping_flag) {
      frame_crop_left_offset                       = 0
      frame_crop_right_offset                      = 0
      frame_crop_top_offset                        = 0
      frame_crop_bottom_offset                     = 4
      }
    vui_parameters_present_flag                    = 1 (true)
    if (vui_parameters_present_flag)
      vui_parameters() {
        aspect_ratio_info_present_flag             = 1 (true)
        if (aspect_ratio_info_present_flag) {
          aspect_ratio_idc                         = 1 (1:1)
          if (aspect_ratio_idc == Extended_SAR) {
            sar_width                              = na
            sar_height                             = na
            }
...
Canon 60D, Canon 5DMK3, Lexar 1000x 128GB CF, Panasonic (shhhh!) GH2s & GH3s. :-)

driftwood

  • Freshman
  • **
  • Posts: 70
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #29 on: April 15, 2013, 11:02:27 PM »
...continued>>>
          }
        overscan_info_present_flag                 = 1 (true)
        if (overscan_info_present_flag)
          overscan_appropriate_flag                = 0 (false)
        video_signal_type_present_flag             = 1 (true)
        if (video_signal_type_present_flag) {
          video_format                             = 5
          video_full_range_flag                    = 1 (true)
          colour_description_present_flag          = 1 (true)
          if (colour_description_present_flag) {
            colour_primaries                       = 1
            transfer_characteristics               = 1
            matrix_coefficients                    = 1
            }
          }
        chroma_location_info_present_flag          = 0 (false)
        if (chroma_loc_info_present_flag) {
          chroma_location_type_top_field           = na
          chroma_location_type_bottom_field        = na
          }
        timing_info_present_flag                   = 1 (true)
        if (timing_info_present_flag) {
          num_units_in_tick                        = 1001
          time_scale                               = 48000
          fixed_frame_rate_flag                    = 1
          }
        nal_hrd_parameters_present_flag            = 1 (true)
        if (nal_hrd_parameters_present_flag)
          nal_hrd_parameters() {
            cpb_cnt_minus1                         = 0 (1)
            bit_rate_scale                         = 4
            cpb_size_scale                         = 6
            for (SchedSelIdx = 0; SchedSelIdx <= cpb_cnt_minus1; SchedSelIdx++) {
              bit_rate_value_minus1[0]             = 69999
              cpb_size_value_minus1[0]             = 62999
              cbr_flag[0]                          = 0
              }
            initial_cpb_removal_delay_length_minus1 = 16
            cpb_removal_delay_length_minus1        = 30
            dpb_output_delay_length_minus1         = 30
            time_offset_length                     = 24
            }
          }
        vcl_hrd_parameters_present_flag            = 1 (true)
        if (vcl_hrd_parameters_present_flag)
          vcl_hrd_parameters()
            cpb_cnt_minus1                         = 0 (1)
            bit_rate_scale                         = 4
            cpb_size_scale                         = 6
            for (SchedSelIdx = 0; SchedSelIdx <= cpb_cnt_minus1; SchedSelIdx++) {
              bit_rate_value_minus1[0]             = 69999
              cpb_size_value_minus1[0]             = 62999
              cbr_flag[0]                          = 0
              }
            initial_cpb_removal_delay_length_minus1 = 16
            cpb_removal_delay_length_minus1        = 30
            dpb_output_delay_length_minus1         = 30
            time_offset_length                     = 24
            }
          }
        if (nal_hrd_parameters_present_flag || vcl_hrd_parameters_present_flag)
          low_delay_hrd_flag                       = 0 (false)
        pic_struct_present_flag                    = 1 (true)
        bitstream_restriction_flag                 = 0 (false)
        if (bitstream_restriction_flag) {
          motion_vectors_over_pic_boundaries_flag  = na
          max_bytes_per_pic_denom                  = na
          max_bits_per_mb_denom                    = na
          log2_max_mv_length_vertical              = na
          log2_max_mv_length_horizontal            = na
          num_reorder_frames                       = na
          max_dec_frame_buffering                  = na
          }
        }
      }
    }
  [00]pic_parameter_set_rbsp() {
    pic_parameter_set_id                           = 0
    seq_parameter_set_id                           = 0
    entropy_coding_mode_flag                       = 0 (CAVLC)
    pic_order_present_flag                         = 1 (true)
    num_slice_groups_minus1                        = 0 (1)
    if (num_slice_groups_minus1 > 0) {
      slice_group_map_type                         = na
      if (slice_group_map_type == 0)
        for (iGroup = 0; iGroup <= num_slice_groups_minus1; iGroup++) {
        }
      else if (slice_group_map_type == 2)
        for (iGroup = 0; iGroup < num_slice_groups_minus1; iGroup++) {
        }
      else if ((slice_group_map_type == 3) || (slice_group_map_type == 4) || (slice_group_map_type == 5)) {
        slice_group_change_direction_flag          = na
        slice_group_change_rate_minus1             = na
      } else if (slice_group_map_type == 6) {
        pic_size_in_map_units_minus1               = na
        for (i = 0; i <= pic_size_in_map_units_minus1; i++)
        }
      }
    num_ref_idx_l0_active_minus1                   = 0 (1)
    num_ref_idx_l1_active_minus1                   = 0 (1)
    weighted_pred_flag                             = 0 (false)
    weighted_bipred_idc                            = 0
    pic_init_qp_minus26                            = 0 (26)
    pic_init_qs_minus26                            = 0 (26)
    chroma_qp_index_offset                         = 0
    deblocking_filter_control_present_flag         = 1 (true)
    constrained_intra_pred_flag                    = 0 (false)
    redundant_pic_cnt_present_flag                 = 0 (false)
    }
  [00]slice_header() {
    first_mb_in_slice                              = 0
    slice_type                                     = 7 (I slice)
    pic_parameter_set_id                           = 0
    frame_num                                      = 0
    if (!frame_mbs_only_flag) {
      field_pic_flag                               = na
      if (field_pic_flag)
        bottom_field_flag                          = na
      }
    if (nal_unit_type == 5)
      idr_pic_id                                   = 12
    if (pic_order_cnt_type == 0) {
      pic_order_cnt_lsb                            = 0
      if (pic_order_present_flag && !field_pic_flag)
        delta_pic_order_cnt_bottom                 = 0
      }
    if (pic_order_cnt_type == 1 && !delta_pic_order_always_zero_flag) {
      delta_pic_order_cnt[0]                       = na
      if (pic_order_present_flag && !field_pic_flag)
        delta_pic_order_cnt[1]                     = na
      }
    if (redundant_pic_cnt_present_flag)
      redundant_pic_cnt                            = na
    if (slice_type == B)
      direct_spatial_mv_pred_flag                  = na
    if (slice_type == P || slice_type == SP || slice_type == B) {
      num_ref_idx_active_override_flag             = na
      if (num_ref_idx_active_override_flag) {
        num_ref_idx_l0_active_minus1               = na
        if (slice_type == B )
          num_ref_idx_l1_active_minus1             = na
        }
      }
    ref_pic_list_reordering()
    if ((weighted_pred_flag && (slice_type == P || slice_type == SP)) || (weighted_bipred_idc == 1 && slice_type == B))
      pred_weight_table()
    if (nal_ref_idc != 0)
      dec_ref_pic_marking()
    if (entropy_coding_mode_flag && slice_type != I && slice_type != SI)
      cabac_init_idc                               = na
    slice_qp_delta                                 = -7
    if (slice_type == SP || slice_type == SI) {
      if (slice_type == SP)
        sp_for_switch_flag                         = na
      slice_qs_delta                               = na
      }
    if (deblocking_filter_control_present_flag) {
      disable_deblocking_filter_idc                = 0
      if (disable_deblocking_filter_idc != 1) {
        slice_alpha_c0_offset_div2                 = 0 (-1)
        slice_beta_offset_div2                     = -2 (-4)
        }
      }
    if (num_slice_groups_minus1 > 0 && slice_group_map_type >= 3 && slice_group_map_type <= 5)
      slice_group_change_cycle                     = na
    }
  [00]sei() {                                      = 16
    buffering_period() {
      seq_parameter_set_id                         = 0
      if (NalHrdBpPresentFlag) {
        for (SchedSelIdx = 0; SchedSelIdx <= cpb_cnt_minus1; SchedSelIdx++) {
          initial_cpb_removal_delay[00]            = 0
          initial_cpb_removal_delay_offset[00]     = 0
          }
        }
      if (VclHrdBpPresentFlag) {
        for (SchedSelIdx = 0; SchedSelIdx <= cpb_cnt_minus1; SchedSelIdx++) {
          initial_cpb_removal_delay[00]            = 0
          initial_cpb_removal_delay_offset[00]     = 0
          }
        }
      }
    }
  [01]sei() {                                      = 16
    pic_timing() {
      if (CpbDpbDelaysPresentFlag) {
        cpb_removal_delay                          = 0
        dpb_output_delay                           = 0
        }
      if (pic_struct_present_flag) {
        pic_struct                                 = 0 (frame)
        for (i = 0; i < NumClockTS; i++) {
          clock_timestamp_flag[0]                  = 0 (false)
          if (clock_timestamp_flag[0]) {
            ct_type                                = na
            nuit_field_based_flag                  = na
            counting_type                          = na
            full_timestamp_flag                    = na
            discontinuity_flag                     = na
            cnt_dropped_flag                       = na
            n_frames                               = na
            if (full_timestamp_flag) {
              seconds_value                        = na
              minutes_value                        = na
              hours_value                          = na
            } else {
              seconds_flag                         = na
              if (seconds_flag) {
                seconds_value                      = na
                minutes_flag                       = na
                if (minutes_flag) {
                  minutes_value                    = na
                  hours_flag                       = na
                  if (hours_flag)
                    hours_value                    = na
                  }
                }
              }
            if (time_offset_length > 0)
              time_offset                          = 0
            }
          }
        }
      }
    }
Canon 60D, Canon 5DMK3, Lexar 1000x 128GB CF, Panasonic (shhhh!) GH2s & GH3s. :-)

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #30 on: April 15, 2013, 11:58:51 PM »
I should make some test vids. There doesn't seem to be a way to use only 4x4 transforms or the files come out black.

Choice seems to be auto pick, 16x16 only or 8x8. Need to find decision point for what gets used and patch it.

Also, what is the difference between the 4x4, 8x8, 16x16 pmodes? Seems you can have a search of 4x4 or 8x8 and not have transform 8x8 flag set.

And what about encoding with no p frames? Is IB better than all I or IPB? Because of timecode max gop is FPS.

All-I seems like a bust. It can't handle QPs as high as IPB because of SD interface limits. Maybe would do better on 5d3 CF card.

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3654
  • Blunt and to the point
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #31 on: April 16, 2013, 05:05:31 AM »
Is there a guide for getting bitrate control to work on 5D3 for dummies?  I'm on a nightly build from March 14th, I don't get any errors showing when loading an ini, but I'm seeing no changes to recordings either.

And what about encoding with no p frames? Is IB better than all I or IPB? Because of timecode max gop is FPS.

All-I seems like a bust. It can't handle QPs as high as IPB because of SD interface limits. Maybe would do better on 5d3 CF card.

I've never known an encoder to do IB only.

I doubt All-I could ever be a serious contention for image quality (for current cameras).  They (I frames) simply require to much bits.  You can up the bits in I frames (and make them good references) in IPB thanks to leaky bucket buffering.

Also, what is the difference between the 4x4, 8x8, 16x16 pmodes?

Quote
H.264 video is split up into 16x16 macroblocks during compression. These blocks can then be further split up into smaller partitions...................
4x4 is generally not very useful and has an extremely high ratio of speed cost to resulting quality gain.

http://mewiki.project357.com/wiki/X264_Settings#partitions

I personally wouldn't be worrying about matracies (yet?).  Thanks to the visual optimizations in H.264, matracies now play (only) a small part in the overall image quality thanks to in-loop deblocking etc.  Bigger gains should be made with GOP size, open-gop, increasing consective B-frames, ref frames, IP and PB ratios.


driftwood, I like the look of these.

chroma_qp_index_offset > Increase QP for chroma.  Human Visual System is less sensitive to chroma.  Increasing the compression in chroma can tweak a little extra 'overall' quality.

weighted_pred_flag
weighted_bipred_idc >  Weighted prediction significantly helps with fades.

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #32 on: April 16, 2013, 06:23:59 AM »
Heh, I would have to port all of this to 5d3. I have the FW, should try at some point.

You should be able to load *some* of the 6D configs.. there are some error 70s that were patched but you just have to lower a couple parameters. Make sure the INI is in the correct spot as it will show the name being loaded even if the INI is not present.

5d3 might be a bust for the gop changing, a1ex said it would write corrupt headers when altered. 6D is not. Maybe just not tested all the way. I dunno if GOP_SLAVE works, it did not on 6D.

I have to post SPS/PPS of some of the different modes since I can get at that stuff now.. Not sure where all the flags are though, they seem dynamically set per frame.

No open gop, going past FPS results in timecode error or camera freeze if you patch the former.

Fixed QP of 5, flush 6, gop 3, I think CBR config. Did not watch on PC yet, only in camera.

http://www.filedropper.com/mvi9218

driftwood

  • Freshman
  • **
  • Posts: 70
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #33 on: April 16, 2013, 02:14:39 PM »
You don't necessarily need to use B frames but it certainly helps with motion prediction with its bi-directional lookup.

If B frames are switched on in an IPB GOP and the GOP is 3 you should only get 'ibb'. At least two consecutive b frames should be used in all IPBs under h264;-

  3 GOP = ibb

  6 GOP = ibbPbb

12 GOP = ibbPbbPbbPbb

15 GOP = ibbPbbPbbPbbPbb

Your MVI_9218 download played back fine on the Mac under Quicktime and Movist. Ill take a look at this in Elecard Stream Analysis

---- POSSIBLE OTHER ENCODER SETTINGS INSIDE? ------

Are there any other encoder settings you have found which instruct the GOP type order of frames/ enable the ipb partitions?

There is a Encoder Setting for 720p, 1080i, and 1080p in the GH2 which allow for example, Encoder Setting 1 720p = 1 to 3

When = 1 (Intra), when = 2 (Intra and P frames only) when = 3 (Full IPB - ie with B frames)

However, when = 1 and the GOP length parameter is > 1 the pic_order_count can go awry, likewise if Encoder Setting 1 720p = 2 or 3 and the GOP is set to = 1 (for Intra) the i frame pic_order is all over the place resulting in playback wobbles.


in-loop deblocking does exactly as it says - it smooths the relationship of side-by-side blocks, with scaling matrices you can actually improve the luma /chroma of the low & hi frequencies. Hence the numbers top left lower than bottom right range in the matrix.
Canon 60D, Canon 5DMK3, Lexar 1000x 128GB CF, Panasonic (shhhh!) GH2s & GH3s. :-)

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #34 on: April 16, 2013, 04:34:50 PM »
There is a setting for how many reference frames to use... I have not tried 2 or 6 in there yet... default is 3, unless in all-I. I got that idea some time last night. Maybe can get IPP somehow. Also, seems i frame written twice at the start in most videos.

I think canon actually does IBPP, IBPP. Just 3 makes IPPIPP. I'll make some more with different settings like rate control or vbr with 8x8 flag forced and auto.

There is a setting to set SPS/PPS directly, I don't know if it includes all/any flags. Besides that have to hack the encoder code directly.

Here is a plain old rate control vid:

http://www.filedropper.com/mvi8982

Also still had issue in one vid with frame skip/drop. Maybe I need to dump to card after 9 frames not 6. The short gop did help a bunch. I took 3 vids in succession. last 2 are fine, the 3rd one is the one uploaded in previous post. The 1st had drops.

* I can make IPP too now.. going longer produces a crash, will try to patch and see if I can make 6 ref frames or different patterns.

driftwood

  • Freshman
  • **
  • Posts: 70
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #35 on: April 16, 2013, 10:11:23 PM »
I analysed the MVI_9218.mov file and had to rip out the annexb stuff using ffmpeg to read it in codecvisa. The strange thing was I saw Slice 0 = B frame, Slice 1 = B frame, Slice 2 = IRD (first Intra reference frame) and the rest wouldn't open. Was that mov file generated with some of the recent changes?

Can you set it to provide a picture parameter set (pps) for every slice/frame?

You only need 2 ref frames to begin with. Get everything else working first!

You said "Just 3 makes IPPIPP." There must be another encoder setting somewhere to enable B frames so that you can do ibb in the 3GOP?

Send me/upload as many variable mov recordings a s you can and I will analyse them
Canon 60D, Canon 5DMK3, Lexar 1000x 128GB CF, Panasonic (shhhh!) GH2s & GH3s. :-)

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #36 on: April 16, 2013, 10:32:50 PM »
I think I mis-typed that.

Its either IPP or IBB... IPP seems to skip more.

Right now porting to 113 and having issues so we'll be back shortly... I hope :)

driftwood

  • Freshman
  • **
  • Posts: 70
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #37 on: April 16, 2013, 10:37:12 PM »
Hang on, I just re-read your earlier post - are you saying the 5DmkIII encoder is the same as the Texas Instruments TMS320DM365 H.264 Encoder?
Canon 60D, Canon 5DMK3, Lexar 1000x 128GB CF, Panasonic (shhhh!) GH2s & GH3s. :-)

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #38 on: April 16, 2013, 11:15:12 PM »
Close... very similar design. Canon changed some parameters. Like initqp of -1 worked and I got that from the docs.

Code: [Select]
I'm on a nightly build from March 14th, I don't get any errors showing when loading an ini, but I'm seeing no changes to recordings either.

I think my little jaunt into 113 answered this riddle... if you're loading configs and no changes are taking place there is a possible explanation. 113 5d3 should be same as 113 6D... was there a 5d3 112?  It seems canon has disabled this mode now. So now have to find a way to enable it to fix 5d3 (if really disabled) and 113 (6D)

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3654
  • Blunt and to the point
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #39 on: April 17, 2013, 08:00:47 AM »
I think my little jaunt into 113 answered this riddle...

That's good.  I was getting worried I was just stupid.  I tried copying the files exactly as in your 6D folder upload, and all manner of other stuff, and it just wasn't working.

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #40 on: April 17, 2013, 05:37:16 PM »
Code: [Select]
    gui_stop_menu();
    call("IVAParamMode", CARD_DRIVE "ML/H264.ini");
    NotifyBox(2000, "%s", 0x4da10);

This is how 5d3 loads a config... so you have to rename to H264.ini... try it that way.

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3654
  • Blunt and to the point
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #41 on: April 18, 2013, 02:11:38 AM »
Code: [Select]
    gui_stop_menu();
    call("IVAParamMode", CARD_DRIVE "ML/H264.ini");
    NotifyBox(2000, "%s", 0x4da10);

This is how 5d3 loads a config... so you have to rename to H264.ini... try it that way.

I've tried that, also with lower case H, copied into different folders, copied onto both cards.  I built the latest nightly also.

Any chance you can add some feedback confirmation to the code.

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #42 on: April 18, 2013, 02:45:43 AM »
If it shows on the screen then its "loaded"... There is a memory location that should turn to 1 when in ivaparam mode.

0x4da10 is where the name gets stored in both the actual function and for ML.

I have to find/update all of these for 5d3. Or its disabled/broken. I am planning on porting the 6D br file to 5d3 but I have no way to test... I guess I can build you a bin once I properly check the firmware... Have to find all of the asserts to patch and rest of memory locations. But... I have the FW so its doable.

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3654
  • Blunt and to the point
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #43 on: April 18, 2013, 03:10:44 AM »
After selecting the option, I get 'ML/H264.ini' overlayed on screen.  After about 1 second, all ML overlays disappear and immediately re-appear.

Does the same thing if I have no ini files on the card.


1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #44 on: April 18, 2013, 04:09:35 AM »
Needs some checking it looks like. Or they disabled it. I'll see what happens with 6D 113

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #45 on: April 22, 2013, 07:40:22 PM »
Ok, appears to be working on 6D 113 so here is a 5d3 built off repo today with br6d instead of br5d3. I think I found all locations correctly but try in C-Mode first so you can reset easily if anything went wrong:

It loads configs like this: call("IVAParamMode", CARD_DRIVE "ML/cbr.ini");

So I think that is the card you have ML on... Try both A/B if nothing happens.

http://www.qfpost.com/file/d?g=RTSntPz1v

BTW.. not sure if GOP is working as it didn't work on 6D with same location g3ggo found... I think he found where it selects B/P/I frame instead of "gop". I don't want to alter video parameters as I have no camera to test.

*fixed the cache hacks which I #ifdef'd but didn't update. I can't find the correct location for one of the player hacks but thats not so serious.

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3654
  • Blunt and to the point
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #46 on: April 23, 2013, 12:31:39 AM »
Maybe I'm stupid, and/or my understanding of how it all works is flawed.  I can't seem to make bitrate changes via ini.  It has to be loading and making a difference though as bitrate viewer shows differences in max bitrate and bitrate pumping where it's either flushing the frames to fast, or not fast enough.  I'm really confused.

Changing 'config loaded' to disabled leads to [1] idle: stack overflow.  Canon dialog and picture freeze, ML dialog artifacts.  Battery has to be pulled.

Changing 'Autoload Conf' to override and adjusting InitQP is where the money is at.  All-I and IPB can both be pushed to 180mb/s (holy fucking crap :) time for a lexar 1000x) on my sandisk 60MB/s cf.

Pushing bitrate to far in IPB mode leads to [7] task main: stack overflow, battery pull.  Pushing to far in All-I leads to canon dialog buffer full, movie stop (no freeze).

Flush rate working good.  Stops bitrate pumping :)

GOP does not appear to be working as reported by mediainfo.  Using InitQP adjustments means files can no longer be opened in bitrate viewer.  In the link below is InitQP 45, Flush 30, GOP 24.

https://dl.dropboxusercontent.com/u/34113196/Camera%20stuff/D46A6572.MOV

edit:  Great time for an update 1%.  I just realized the 5D3 got RAW histogram too :)

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #47 on: April 23, 2013, 01:06:36 AM »
I made an oops: I set enco mode to wrong location... it was overwriting a pointer not mode :(

http://www.qfpost.com/file/d?g=WivCFe2se

Have some raw spot meter too :)

New StreamEye will analyze... if you recontainerize they will analyze too.

Also, you can set autoload to off and adjust the default profile 4.1 config. But configs should load with correct location.

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3654
  • Blunt and to the point
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #48 on: April 23, 2013, 01:46:48 AM »
Crash on config disable gone.
Can still make it crash on massive bitrates in IPB.

Changing Autoload Conf (override) to (off) still allows changing of InitQP.  You have to exit Q menu and load config or else it stays in override even with the option set to off.

Both of these are giving level 4.1 with the same bitrate

Code: [Select]
Transform8x8Flag = 2
Profile = 100
Level = 41
BitRate = 120000000
EntropyCodingMode = 1
IntraPicInitQP = -1
InterPicInitQP = -1
QpOffsetForB = 0
MinQpI = 1
MinQpP = 1
MinQpB = 1
MaxQpI = 26
MaxQpP = 26
MaxQpB = 26
MinBitrate = 40000000
MaxBitrate = 120000000
SarWidth = 0
SarHeight = 0
AspectRatioIdc = 1
VideoFmtAndVspFlag = 81
VideoFullRangeFlag = 1
TimingInfoPresentFlag = 0
RateControlEnable = 1

Code: [Select]
Transform8x8Flag = 2
Profile = 100
Level = 51
BitRate = 550000000
EntropyCodingMode = 1
IntraPicInitQP = 5
InterPicInitQP = 5
QpOffsetForB = 0
MinQpI = 1
MinQpP = 1
MinQpB = 1
MaxQpI = 13
MaxQpP = 13
MaxQpB = 13
MinBitrate = 120000000
MaxBitrate = 550000000
SarWidth = 0
SarHeight = 0
AspectRatioIdc = 1
VideoFmtAndVspFlag = 81
VideoFullRangeFlag = 1
TimingInfoPresentFlag = 0
RateControlEnable = 0

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: 5d3/6D IVA Params Hacking. The new BR control on FF digic V.
« Reply #49 on: April 23, 2013, 01:58:16 AM »
Its weird that profile changing isn't taking. Try All_I with 4.1 or downgrading 4.1 to 4.0.

Did the CABAC setting take?

That is Fixed QP5 vs Rate control, Should be different. Unless canon neutered configs on 5d3 somehow.

And yes, menu has to be reloaded to re-read whether config is loaded or not.

Also is it showing the correct drive on the screen when it loads a config? Not sure what ML takes as CARD_DRIVE

It should work Like:

Autoload ON: Set initqp or BR and changes don't take effect, read from config.
Override: Loads Config + Overrides InitQP + Target Rate if set
Autoload OFF: pref from a cold boot- change INITQP and Target, should apply when you leave menu

It may show an initQP/BR set with autoload or when it hasn't updated yet. Then should write OFF over it.