View Issue Details

IDProjectCategoryView StatusLast Update
0000247JVT JM H.264/AVC reference softwareencoderpublic2011-03-10 12:04
ReporterDiego F. de Souza Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product VersionJM 17.2 
Summary0000247: Setting a wrong coding state in submacroblock_mode_decision_p(b)_slice function in mode_decision_P8x8.c
DescriptionI believe there is a mistake in mode_decision_P8x8.c in the last part of submacroblock_mode_decision_p_slice and submacroblock_mode_decision_b_slice functions, which is shown below:

    //===== set the coding state after current block =====
    //if (transform8x8 == 0 || block < 3)
    if (stored_state_8x8 == TRUE)
      currSlice->reset_coding_state (currMB, currSlice->p_RDO->cs_b8);
    else
    {
      currSlice->reset_coding_state (currMB, currSlice->p_RDO->cs_cm);
      update_adaptive_rounding_8x8(p_Vid, p_Inp, dataTr, fadjust);
    }

I think currSlice->p_RDO->cs_b8 is only used when SubMBCodingState is set to 2 (highest complexity). However, when the JM17.2 is running on medium complexity (in other words, SubMBCodingState is set to 1) the submacroblok coding state should be reset to master coding state at the end of each block. So, I think the code should be changed to this:


    //===== set the coding state after current block =====
    //if (transform8x8 == 0 || block < 3)
    if ((stored_state_8x8 == TRUE) && (p_Inp->subMBCodingState == 2))
      currSlice->reset_coding_state (currMB, currSlice->p_RDO->cs_b8);
    else
    {
      currSlice->reset_coding_state (currMB, currSlice->p_RDO->cs_cm);
      update_adaptive_rounding_8x8(p_Vid, p_Inp, dataTr, fadjust);
    }
Additional InformationWithout the suggested change and SubMBCodingState=1, the rate of the first mode in the next block will be calculated using the submacroblock coding state set to the best 8x8 coding state of the last 8x8 block (p_RDO->cs_tmp), and the rate of the next mode will be calculated using with the submacroblock coding state set to the master coding state (p_RDO->cs_cm), due to following lines:

      //--- re-set coding state as it was before coding with current mode was performed ---
      if (index != maxindex - 1)
      {
        if(p_Inp->subMBCodingState == 1)
          currSlice->reset_coding_state (currMB, currSlice->p_RDO->cs_cm);
        else if(p_Inp->subMBCodingState == 2)
          currSlice->reset_coding_state (currMB, currSlice->p_RDO->cs_tmp);
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2011-03-10 12:04 Diego F. de Souza New Issue