Commit 93b6931f authored by posciak@chromium.org's avatar posciak@chromium.org

VAVDA: Fix Baseline profile handling in H264 parser.

This fixes initialization of stream parameters for Baseline profile and
thus the "green-video" bug (135548). Chroma parameters were not being set
up properly for that profile.

BUG=135548
TEST=manual run of affected streams


Review URL: https://chromiumcodereview.appspot.com/10821043

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148623 0039d316-1c4b-4281-b951-d872f2087c98
parent 08ad9575
...@@ -654,9 +654,14 @@ H264Parser::Result H264Parser::ParsePPSScalingLists(const H264SPS& sps, ...@@ -654,9 +654,14 @@ H264Parser::Result H264Parser::ParsePPSScalingLists(const H264SPS& sps,
} }
static void FillDefaultSeqScalingLists(H264SPS* sps) { static void FillDefaultSeqScalingLists(H264SPS* sps) {
// Assumes ints in arrays. for (int i = 0; i < 6; ++i)
memset(sps->scaling_list4x4, 16, sizeof(sps->scaling_list4x4)); for (int j = 0; j < kH264ScalingList4x4Length; ++j)
memset(sps->scaling_list8x8, 16, sizeof(sps->scaling_list8x8)); sps->scaling_list4x4[i][j] = 16;
for (int i = 0; i < 6; ++i)
for (int j = 0; j < kH264ScalingList8x8Length; ++j)
sps->scaling_list8x8[i][j] = 16;
} }
H264Parser::Result H264Parser::ParseSPS(int* sps_id) { H264Parser::Result H264Parser::ParseSPS(int* sps_id) {
...@@ -686,11 +691,6 @@ H264Parser::Result H264Parser::ParseSPS(int* sps_id) { ...@@ -686,11 +691,6 @@ H264Parser::Result H264Parser::ParseSPS(int* sps_id) {
if (sps->chroma_format_idc == 3) if (sps->chroma_format_idc == 3)
READ_BOOL_OR_RETURN(&sps->separate_colour_plane_flag); READ_BOOL_OR_RETURN(&sps->separate_colour_plane_flag);
if (sps->separate_colour_plane_flag)
sps->chroma_array_type = 0;
else
sps->chroma_array_type = sps->chroma_format_idc;
READ_UE_OR_RETURN(&sps->bit_depth_luma_minus8); READ_UE_OR_RETURN(&sps->bit_depth_luma_minus8);
TRUE_OR_RETURN(sps->bit_depth_luma_minus8 < 7); TRUE_OR_RETURN(sps->bit_depth_luma_minus8 < 7);
...@@ -708,8 +708,16 @@ H264Parser::Result H264Parser::ParseSPS(int* sps_id) { ...@@ -708,8 +708,16 @@ H264Parser::Result H264Parser::ParseSPS(int* sps_id) {
} else { } else {
FillDefaultSeqScalingLists(sps.get()); FillDefaultSeqScalingLists(sps.get());
} }
} else {
sps->chroma_format_idc = 1;
FillDefaultSeqScalingLists(sps.get());
} }
if (sps->separate_colour_plane_flag)
sps->chroma_array_type = 0;
else
sps->chroma_array_type = sps->chroma_format_idc;
READ_UE_OR_RETURN(&sps->log2_max_frame_num_minus4); READ_UE_OR_RETURN(&sps->log2_max_frame_num_minus4);
TRUE_OR_RETURN(sps->log2_max_frame_num_minus4 < 13); TRUE_OR_RETURN(sps->log2_max_frame_num_minus4 < 13);
...@@ -807,6 +815,7 @@ H264Parser::Result H264Parser::ParsePPS(int* pps_id) { ...@@ -807,6 +815,7 @@ H264Parser::Result H264Parser::ParsePPS(int* pps_id) {
READ_SE_OR_RETURN(&pps->chroma_qp_index_offset); READ_SE_OR_RETURN(&pps->chroma_qp_index_offset);
IN_RANGE_OR_RETURN(pps->chroma_qp_index_offset, -12, 12); IN_RANGE_OR_RETURN(pps->chroma_qp_index_offset, -12, 12);
pps->second_chroma_qp_index_offset = pps->chroma_qp_index_offset;
READ_BOOL_OR_RETURN(&pps->deblocking_filter_control_present_flag); READ_BOOL_OR_RETURN(&pps->deblocking_filter_control_present_flag);
READ_BOOL_OR_RETURN(&pps->constrained_intra_pred_flag); READ_BOOL_OR_RETURN(&pps->constrained_intra_pred_flag);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment