View Issue Details

IDProjectCategoryView StatusLast Update
0000280JVT JM H.264/AVC reference softwaredecoderpublic2011-11-08 19:13
ReporterJianjun Assigned ToAlexis Michael Tourapis  
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Target VersionJM 18.1Fixed in VersionJM 18.1 
Summary0000280: JM conflict with H.264 spec when separate_colour_plane_flag=1
DescriptionI tried to decode one h.264 file(attached, separate_colour_plane_flag=1) by two different JM versions, got different YUV output. Checking the JM code, the difference is:

In JM13.2 block.c/itrans2():
qp_per = (img->qp + img->bitdepth_luma_qp_scale - MIN_QP)/6;
qp_rem = (img->qp + img->bitdepth_luma_qp_scale - MIN_QP)%6;

In JM18.0 read_comp_cabac.c/read_CBP_and_coeffs_from_NAL_CABAC_420():
qp_per = p_Vid->qp_per_matrix[ currMB->qp_scaled[currSlice->colour_plane_id] ];
qp_rem = p_Vid->qp_rem_matrix[ currMB->qp_scaled[currSlice->colour_plane_id] ];

So JM13.2 is using luma qp for all Cb/Cr plane, but JM18.0 is using Cb/Cr qp for Cb/Cr plane.

According to h.264 spec, seems JM13.2 (using luma qp for cb/cr plane) is correct:
“When ChromaArrayType is equal to 0, the values of bit_depth_chroma_minus8, chroma_qp_index_offset and second_chroma_qp_index_offset are not used in the decoding process”

Is it a bug in JM18.0, or h.264 spec should be updated?
TagsNo tags attached.

Activities

Jianjun

2011-10-13 08:37

reporter  

test.264 (84,511 bytes)

Alexis Michael Tourapis

2011-10-13 08:56

developer   ~0000500

Last edited: 2011-10-13 08:57

Unfortunately, I don't have time to check this right now, but this sounds a bit weird. Why would for a 4:4:4 format the 4:2:0 function be called? Are you certain that this function is called during decoding? Instead I would expect the 400 function to be called instead.

Jianjun

2011-10-13 09:14

reporter   ~0000501

Yes, i set a break point at that function and it can hit.
The function pointer init is:
void set_read_CBP_and_coeffs_cabac(Slice *currSlice)
{
  if ( currSlice->p_Vid->active_sps->chroma_format_idc==YUV444 && (currSlice->p_Vid->separate_colour_plane_flag == 0) )
    currSlice->read_CBP_and_coeffs_from_NAL = read_CBP_and_coeffs_from_NAL_CABAC_444;
  else if (currSlice->p_Vid->active_sps->chroma_format_idc == YUV422)
    currSlice->read_CBP_and_coeffs_from_NAL = read_CBP_and_coeffs_from_NAL_CABAC_422;
  else if (currSlice->p_Vid->active_sps->chroma_format_idc == YUV400)
    currSlice->read_CBP_and_coeffs_from_NAL = read_CBP_and_coeffs_from_NAL_CABAC_400;
  else
    currSlice->read_CBP_and_coeffs_from_NAL = read_CBP_and_coeffs_from_NAL_CABAC_420;
}

Jianjun

2011-10-14 10:58

reporter   ~0000502

Alexis, could you tell me what qp should used for Cb/Cr plane? Just use luma qp as what H.264 spec says or need to use chroma qp?

Karsten Suehring

2011-10-27 00:10

administrator   ~0000504

In case of mismatch always the software has to be updated.

At the moment I don't completely understand how colour_plane_id is used for indexing the different components with separate_colour_plane_flag=1. But looking looking at itrans_2 it seems that currMB->qp_scaled[0] should be used.

But I agree with Alexis that probably the 4:0:0 function should be called in this case.

Karsten Suehring

2011-11-08 19:13

administrator   ~0000512

should be resolved by Alexis' checkin

Issue History

Date Modified Username Field Change
2011-10-13 08:37 Jianjun New Issue
2011-10-13 08:38 Jianjun File Added: test.264
2011-10-13 08:56 Alexis Michael Tourapis Note Added: 0000500
2011-10-13 08:57 Alexis Michael Tourapis Note Edited: 0000500
2011-10-13 09:14 Jianjun Note Added: 0000501
2011-10-14 10:58 Jianjun Note Added: 0000502
2011-10-27 00:10 Karsten Suehring Note Added: 0000504
2011-10-27 00:10 Karsten Suehring Assigned To => Karsten Suehring
2011-10-27 00:10 Karsten Suehring Status new => acknowledged
2011-10-28 17:26 Karsten Suehring Target Version => JM 18.1
2011-11-08 19:13 Karsten Suehring Note Added: 0000512
2011-11-08 19:13 Karsten Suehring Status acknowledged => resolved
2011-11-08 19:13 Karsten Suehring Fixed in Version => JM 18.1
2011-11-08 19:13 Karsten Suehring Resolution open => fixed
2011-11-08 19:13 Karsten Suehring Assigned To Karsten Suehring => Alexis Michael Tourapis