View Issue Details

IDProjectCategoryView StatusLast Update
0000298JVT JM H.264/AVC reference softwaredecoderpublic2013-03-28 19:49
ReporterJianjun Assigned ToKarsten Suehring  
PrioritynormalSeverityminorReproducibilityalways
Status feedbackResolutionreopened 
Fixed in VersionJM 18.4 
Summary0000298: YUV420 Lossless CAVLC decoding has problem
DescriptionIn JM18.3 read_comp_cavlc.c read_CBP_and_coeffs_from_NAL_CAVLC_420():
if (smb || (currMB->is_lossless == TRUE)) // check to see if MB type is SPred or SIntra4x4
      {
        currSlice->cof[PLANE_U + uv][0][0] = currSlice->cofu[0];
        currSlice->cof[PLANE_U + uv][4][0] = currSlice->cofu[1];
        currSlice->cof[PLANE_U + uv][0][4] = currSlice->cofu[2];
        currSlice->cof[PLANE_U + uv][4][4] = currSlice->cofu[3];
        //currSlice->fcf[PLANE_U + uv][0][0] = currSlice->cofu[0];
        //currSlice->fcf[PLANE_U + uv][4][0] = currSlice->cofu[1];
        //currSlice->fcf[PLANE_U + uv][0][4] = currSlice->cofu[2];
        //currSlice->fcf[PLANE_U + uv][4][4] = currSlice->cofu[3];
      }

It has a index typo, it should be:
if (smb || (currMB->is_lossless == TRUE)) // check to see if MB type is SPred or SIntra4x4
      {
        currSlice->cof[PLANE_U + uv][0][0] = currSlice->cofu[0];
        currSlice->cof[PLANE_U + uv][0][4] = currSlice->cofu[1];
        currSlice->cof[PLANE_U + uv][4][0] = currSlice->cofu[2];
        currSlice->cof[PLANE_U + uv][4][4] = currSlice->cofu[3];
        //currSlice->fcf[PLANE_U + uv][0][0] = currSlice->cofu[0];
        //currSlice->fcf[PLANE_U + uv][4][0] = currSlice->cofu[1];
        //currSlice->fcf[PLANE_U + uv][0][4] = currSlice->cofu[2];
        //currSlice->fcf[PLANE_U + uv][4][4] = currSlice->cofu[3];
      }
It is correct in JM17.0, should be wrongly updated in later version, and CABAC path is correct.
TagsNo tags attached.

Activities

Jianjun

2012-04-20 09:00

reporter  

test.264 (68,459 bytes)

Jianjun

2012-04-20 09:14

reporter   ~0000529

Have attached the bitstream, the decoded uv plane is in mess.

Jianjun

2012-05-11 03:49

reporter   ~0000530

Add another two issues:
1) In block.c iTransform(...), it will call itrans4x4_ls(...), there is no valid data in currSlice->mb_rres[ ].
2) In read_comp_cavlc.c read_CBP_and_coeffs_from_NAL_CAVLC_420(...), read_comp_coeff_4x4_CAVLC/read_comp_coeff_8x8_CAVLC fuction pointer is not updated by mb level, this means it can not handle Lossless/Lossy mb switch. Adding set_read_comp_coeff_cavlc(currMB) before read_comp_coeff_xxx_CAVLC() can solve this issue.

Karsten Suehring

2012-07-19 18:08

administrator   ~0000555

I applied the suggested fix to the current dev branch

Karsten Suehring

2012-07-19 18:12

administrator   ~0000556

while fixing the first issue, I did not see the addtional issues in the comments. these should be filed a singe bugs. trying to reopen the issue

Alexis Michael Tourapis

2013-03-28 19:49

developer   ~0000564

On the second error rerported, the observation is correct. It seems that the easiest place where to add the set functions (both for CAVLC and CABAC) are in void update_qp(Macroblock *currMB, int qp). Basically the function would look like this:

void update_qp(Macroblock *currMB, int qp)
{
  VideoParameters *p_Vid = currMB->p_Vid;
  currMB->qp = qp;
  currMB->qp_scaled[0] = qp + p_Vid->bitdepth_luma_qp_scale;
  set_chroma_qp(currMB);
  currMB->is_lossless = (Boolean) ((currMB->qp_scaled[0] == 0) && (p_Vid->lossless_qpprime_flag == 1));
  set_read_comp_coeff_cavlc(currMB);
  set_read_comp_coeff_cabac(currMB);
}

Issue History

Date Modified Username Field Change
2012-04-16 12:15 Jianjun New Issue
2012-04-20 09:00 Jianjun File Added: test.264
2012-04-20 09:14 Jianjun Note Added: 0000529
2012-05-11 03:49 Jianjun Note Added: 0000530
2012-07-19 18:08 Karsten Suehring Note Added: 0000555
2012-07-19 18:08 Karsten Suehring Status new => resolved
2012-07-19 18:08 Karsten Suehring Fixed in Version => JM 18.4
2012-07-19 18:08 Karsten Suehring Resolution open => fixed
2012-07-19 18:08 Karsten Suehring Assigned To => Karsten Suehring
2012-07-19 18:12 Karsten Suehring Note Added: 0000556
2012-07-19 18:12 Karsten Suehring Status resolved => feedback
2012-07-19 18:12 Karsten Suehring Resolution fixed => reopened
2013-03-28 19:49 Alexis Michael Tourapis Note Added: 0000564