Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: media/filters/h264_parser.cc

Issue 2702973002: h264_parser: Swap the fallback rule A & B for pic scaling matrix. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "media/filters/h264_parser.h" 5 #include "media/filters/h264_parser.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 res = ParseScalingList(arraysize(pps->scaling_list4x4[i]), 732 res = ParseScalingList(arraysize(pps->scaling_list4x4[i]),
733 pps->scaling_list4x4[i], 733 pps->scaling_list4x4[i],
734 &use_default); 734 &use_default);
735 if (res != kOk) 735 if (res != kOk)
736 return res; 736 return res;
737 737
738 if (use_default) 738 if (use_default)
739 DefaultScalingList4x4(i, pps->scaling_list4x4); 739 DefaultScalingList4x4(i, pps->scaling_list4x4);
740 740
741 } else { 741 } else {
742 if (sps.seq_scaling_matrix_present_flag) { 742 if (!sps.seq_scaling_matrix_present_flag) {
743 // Table 7-2 fallback rule A in spec. 743 // Table 7-2 fallback rule A in spec.
744 FallbackScalingList4x4( 744 FallbackScalingList4x4(
745 i, kDefault4x4Intra, kDefault4x4Inter, pps->scaling_list4x4); 745 i, kDefault4x4Intra, kDefault4x4Inter, pps->scaling_list4x4);
746 } else { 746 } else {
747 // Table 7-2 fallback rule B in spec. 747 // Table 7-2 fallback rule B in spec.
748 FallbackScalingList4x4(i, 748 FallbackScalingList4x4(i,
749 sps.scaling_list4x4[0], 749 sps.scaling_list4x4[0],
750 sps.scaling_list4x4[3], 750 sps.scaling_list4x4[3],
751 pps->scaling_list4x4); 751 pps->scaling_list4x4);
752 } 752 }
753 } 753 }
754 } 754 }
755 755
756 if (pps->transform_8x8_mode_flag) { 756 if (pps->transform_8x8_mode_flag) {
757 for (int i = 0; i < ((sps.chroma_format_idc != 3) ? 2 : 6); ++i) { 757 for (int i = 0; i < ((sps.chroma_format_idc != 3) ? 2 : 6); ++i) {
758 READ_BOOL_OR_RETURN(&pic_scaling_list_present_flag); 758 READ_BOOL_OR_RETURN(&pic_scaling_list_present_flag);
759 759
760 if (pic_scaling_list_present_flag) { 760 if (pic_scaling_list_present_flag) {
761 res = ParseScalingList(arraysize(pps->scaling_list8x8[i]), 761 res = ParseScalingList(arraysize(pps->scaling_list8x8[i]),
762 pps->scaling_list8x8[i], 762 pps->scaling_list8x8[i],
763 &use_default); 763 &use_default);
764 if (res != kOk) 764 if (res != kOk)
765 return res; 765 return res;
766 766
767 if (use_default) 767 if (use_default)
768 DefaultScalingList8x8(i, pps->scaling_list8x8); 768 DefaultScalingList8x8(i, pps->scaling_list8x8);
769 769
770 } else { 770 } else {
771 if (sps.seq_scaling_matrix_present_flag) { 771 if (!sps.seq_scaling_matrix_present_flag) {
772 // Table 7-2 fallback rule A in spec. 772 // Table 7-2 fallback rule A in spec.
773 FallbackScalingList8x8( 773 FallbackScalingList8x8(
774 i, kDefault8x8Intra, kDefault8x8Inter, pps->scaling_list8x8); 774 i, kDefault8x8Intra, kDefault8x8Inter, pps->scaling_list8x8);
775 } else { 775 } else {
776 // Table 7-2 fallback rule B in spec. 776 // Table 7-2 fallback rule B in spec.
777 FallbackScalingList8x8(i, 777 FallbackScalingList8x8(i,
778 sps.scaling_list8x8[0], 778 sps.scaling_list8x8[0],
779 sps.scaling_list8x8[1], 779 sps.scaling_list8x8[1],
780 pps->scaling_list8x8); 780 pps->scaling_list8x8);
781 } 781 }
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
1475 1475
1476 default: 1476 default:
1477 DVLOG(4) << "Unsupported SEI message"; 1477 DVLOG(4) << "Unsupported SEI message";
1478 break; 1478 break;
1479 } 1479 }
1480 1480
1481 return kOk; 1481 return kOk;
1482 } 1482 }
1483 1483
1484 } // namespace media 1484 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698