| 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 "content/common/gpu/media/h264_parser.h" | 5 #include "content/common/gpu/media/h264_parser.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 | 10 |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 } | 642 } |
| 643 | 643 |
| 644 static void FillDefaultSeqScalingLists(H264SPS* sps) { | 644 static void FillDefaultSeqScalingLists(H264SPS* sps) { |
| 645 // Assumes ints in arrays. | 645 // Assumes ints in arrays. |
| 646 memset(sps->scaling_list4x4, 16, sizeof(sps->scaling_list4x4)); | 646 memset(sps->scaling_list4x4, 16, sizeof(sps->scaling_list4x4)); |
| 647 memset(sps->scaling_list8x8, 16, sizeof(sps->scaling_list8x8)); | 647 memset(sps->scaling_list8x8, 16, sizeof(sps->scaling_list8x8)); |
| 648 } | 648 } |
| 649 | 649 |
| 650 H264Parser::Result H264Parser::ParseSPS(int* sps_id) { | 650 H264Parser::Result H264Parser::ParseSPS(int* sps_id) { |
| 651 // See 7.4.2.1. | 651 // See 7.4.2.1. |
| 652 int data; | |
| 653 Result res; | 652 Result res; |
| 654 | 653 |
| 655 *sps_id = -1; | 654 *sps_id = -1; |
| 656 | 655 |
| 657 scoped_ptr<H264SPS> sps(new H264SPS()); | 656 scoped_ptr<H264SPS> sps(new H264SPS()); |
| 658 | 657 |
| 659 READ_BITS_OR_RETURN(8, &sps->profile_idc); | 658 READ_BITS_OR_RETURN(8, &sps->profile_idc); |
| 660 // Skip constraint_setx_flag and reserved flags. | 659 READ_BITS_OR_RETURN(8, &sps->constraint_setx_flag); |
| 661 READ_BITS_OR_RETURN(8, &data); | |
| 662 READ_BITS_OR_RETURN(8, &sps->level_idc); | 660 READ_BITS_OR_RETURN(8, &sps->level_idc); |
| 663 READ_UE_OR_RETURN(&sps->seq_parameter_set_id); | 661 READ_UE_OR_RETURN(&sps->seq_parameter_set_id); |
| 664 TRUE_OR_RETURN(sps->seq_parameter_set_id < 32); | 662 TRUE_OR_RETURN(sps->seq_parameter_set_id < 32); |
| 665 | 663 |
| 666 if (sps->profile_idc == 100 || sps->profile_idc == 110 || | 664 if (sps->profile_idc == 100 || sps->profile_idc == 110 || |
| 667 sps->profile_idc == 122 || sps->profile_idc == 244 || | 665 sps->profile_idc == 122 || sps->profile_idc == 244 || |
| 668 sps->profile_idc == 44 || sps->profile_idc == 83 || | 666 sps->profile_idc == 44 || sps->profile_idc == 83 || |
| 669 sps->profile_idc == 86 || sps->profile_idc == 118 || | 667 sps->profile_idc == 86 || sps->profile_idc == 118 || |
| 670 sps->profile_idc == 128) { | 668 sps->profile_idc == 128) { |
| 671 READ_UE_OR_RETURN(&sps->chroma_format_idc); | 669 READ_UE_OR_RETURN(&sps->chroma_format_idc); |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1190 | 1188 |
| 1191 default: | 1189 default: |
| 1192 DVLOG(4) << "Unsupported SEI message"; | 1190 DVLOG(4) << "Unsupported SEI message"; |
| 1193 break; | 1191 break; |
| 1194 } | 1192 } |
| 1195 | 1193 |
| 1196 return kOk; | 1194 return kOk; |
| 1197 } | 1195 } |
| 1198 | 1196 |
| 1199 } // namespace content | 1197 } // namespace content |
| OLD | NEW |