Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "base/stl_util.h" | 6 #include "base/stl_util.h" |
| 7 #include "content/common/gpu/media/h264_parser.h" | 7 #include "content/common/gpu/media/h264_parser.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 | 10 |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 640 } | 640 } |
| 641 | 641 |
| 642 static void FillDefaultSeqScalingLists(H264SPS* sps) { | 642 static void FillDefaultSeqScalingLists(H264SPS* sps) { |
| 643 // Assumes ints in arrays. | 643 // Assumes ints in arrays. |
| 644 memset(sps->scaling_list4x4, 16, sizeof(sps->scaling_list4x4)); | 644 memset(sps->scaling_list4x4, 16, sizeof(sps->scaling_list4x4)); |
| 645 memset(sps->scaling_list8x8, 16, sizeof(sps->scaling_list8x8)); | 645 memset(sps->scaling_list8x8, 16, sizeof(sps->scaling_list8x8)); |
| 646 } | 646 } |
| 647 | 647 |
| 648 H264Parser::Result H264Parser::ParseSPS(int* sps_id) { | 648 H264Parser::Result H264Parser::ParseSPS(int* sps_id) { |
| 649 // See 7.4.2.1. | 649 // See 7.4.2.1. |
| 650 int data; | |
| 651 Result res; | 650 Result res; |
| 652 | 651 |
| 653 *sps_id = -1; | 652 *sps_id = -1; |
| 654 | 653 |
| 655 scoped_ptr<H264SPS> sps(new H264SPS()); | 654 scoped_ptr<H264SPS> sps(new H264SPS()); |
| 656 | 655 |
| 657 READ_BITS_OR_RETURN(8, &sps->profile_idc); | 656 READ_BITS_OR_RETURN(8, &sps->profile_idc); |
| 658 // Skip constraint_setx_flag and reserved flags. | 657 READ_BITS_OR_RETURN(8, &sps->constraint_setx_flag); |
|
Pawel Osciak
2012/05/30 00:28:40
There are only 6 bits of flags, the last 2 bits ar
sail
2012/06/02 21:05:49
Done.
It looks like the last 4 bytes are supposed
| |
| 659 READ_BITS_OR_RETURN(8, &data); | |
| 660 READ_BITS_OR_RETURN(8, &sps->level_idc); | 658 READ_BITS_OR_RETURN(8, &sps->level_idc); |
| 661 READ_UE_OR_RETURN(&sps->seq_parameter_set_id); | 659 READ_UE_OR_RETURN(&sps->seq_parameter_set_id); |
| 662 TRUE_OR_RETURN(sps->seq_parameter_set_id < 32); | 660 TRUE_OR_RETURN(sps->seq_parameter_set_id < 32); |
| 663 | 661 |
| 664 if (sps->profile_idc == 100 || sps->profile_idc == 110 || | 662 if (sps->profile_idc == 100 || sps->profile_idc == 110 || |
| 665 sps->profile_idc == 122 || sps->profile_idc == 244 || | 663 sps->profile_idc == 122 || sps->profile_idc == 244 || |
| 666 sps->profile_idc == 44 || sps->profile_idc == 83 || | 664 sps->profile_idc == 44 || sps->profile_idc == 83 || |
| 667 sps->profile_idc == 86 || sps->profile_idc == 118 || | 665 sps->profile_idc == 86 || sps->profile_idc == 118 || |
| 668 sps->profile_idc == 128) { | 666 sps->profile_idc == 128) { |
| 669 READ_UE_OR_RETURN(&sps->chroma_format_idc); | 667 READ_UE_OR_RETURN(&sps->chroma_format_idc); |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1190 default: | 1188 default: |
| 1191 DVLOG(4) << "Unsupported SEI message"; | 1189 DVLOG(4) << "Unsupported SEI message"; |
| 1192 break; | 1190 break; |
| 1193 } | 1191 } |
| 1194 | 1192 |
| 1195 return kOk; | 1193 return kOk; |
| 1196 } | 1194 } |
| 1197 | 1195 |
| 1198 } // namespace content | 1196 } // namespace content |
| 1199 | 1197 |
| OLD | NEW |