OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // This file contains an implementation of a VP8 raw stream parser, | 5 // This file contains an implementation of a VP8 raw stream parser, |
6 // as defined in RFC 6386. | 6 // as defined in RFC 6386. |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "media/filters/vp8_parser.h" | 9 #include "media/filters/vp8_parser.h" |
10 | 10 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 | 146 |
147 fhdr->segmentation_hdr = curr_segmentation_hdr_; | 147 fhdr->segmentation_hdr = curr_segmentation_hdr_; |
148 | 148 |
149 if (!ParseLoopFilterHeader(keyframe)) | 149 if (!ParseLoopFilterHeader(keyframe)) |
150 return false; | 150 return false; |
151 | 151 |
152 fhdr->loopfilter_hdr = curr_loopfilter_hdr_; | 152 fhdr->loopfilter_hdr = curr_loopfilter_hdr_; |
153 | 153 |
154 int log2_nbr_of_dct_partitions; | 154 int log2_nbr_of_dct_partitions; |
155 BD_READ_UNSIGNED_OR_RETURN(2, &log2_nbr_of_dct_partitions); | 155 BD_READ_UNSIGNED_OR_RETURN(2, &log2_nbr_of_dct_partitions); |
156 fhdr->num_of_dct_partitions = | 156 fhdr->num_of_dct_partitions = static_cast<size_t>(1) |
157 static_cast<size_t>(1 << log2_nbr_of_dct_partitions); | 157 << log2_nbr_of_dct_partitions; |
158 | 158 |
159 if (!ParseQuantizationHeader(&fhdr->quantization_hdr)) | 159 if (!ParseQuantizationHeader(&fhdr->quantization_hdr)) |
160 return false; | 160 return false; |
161 | 161 |
162 if (keyframe) { | 162 if (keyframe) { |
163 BD_READ_BOOL_OR_RETURN(&fhdr->refresh_entropy_probs); | 163 BD_READ_BOOL_OR_RETURN(&fhdr->refresh_entropy_probs); |
164 } else { | 164 } else { |
165 BD_READ_BOOL_OR_RETURN(&fhdr->refresh_golden_frame); | 165 BD_READ_BOOL_OR_RETURN(&fhdr->refresh_golden_frame); |
166 BD_READ_BOOL_OR_RETURN(&fhdr->refresh_alternate_frame); | 166 BD_READ_BOOL_OR_RETURN(&fhdr->refresh_alternate_frame); |
167 | 167 |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 fhdr->dct_partition_sizes[fhdr->num_of_dct_partitions - 1] = bytes_left; | 863 fhdr->dct_partition_sizes[fhdr->num_of_dct_partitions - 1] = bytes_left; |
864 | 864 |
865 DVLOG(4) << "Control part size: " << fhdr->first_part_size; | 865 DVLOG(4) << "Control part size: " << fhdr->first_part_size; |
866 for (size_t i = 0; i < fhdr->num_of_dct_partitions; ++i) | 866 for (size_t i = 0; i < fhdr->num_of_dct_partitions; ++i) |
867 DVLOG(4) << "DCT part " << i << " size: " << fhdr->dct_partition_sizes[i]; | 867 DVLOG(4) << "DCT part " << i << " size: " << fhdr->dct_partition_sizes[i]; |
868 | 868 |
869 return true; | 869 return true; |
870 } | 870 } |
871 | 871 |
872 } // namespace media | 872 } // namespace media |
OLD | NEW |