| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 int mode; | 235 int mode; |
| 236 BD_READ_UNSIGNED_OR_RETURN(1, &mode); | 236 BD_READ_UNSIGNED_OR_RETURN(1, &mode); |
| 237 shdr->segment_feature_mode = | 237 shdr->segment_feature_mode = |
| 238 static_cast<Vp8SegmentationHeader::SegmentFeatureMode>(mode); | 238 static_cast<Vp8SegmentationHeader::SegmentFeatureMode>(mode); |
| 239 | 239 |
| 240 for (size_t i = 0; i < kMaxMBSegments; ++i) { | 240 for (size_t i = 0; i < kMaxMBSegments; ++i) { |
| 241 bool quantizer_update; | 241 bool quantizer_update; |
| 242 BD_READ_BOOL_OR_RETURN(&quantizer_update); | 242 BD_READ_BOOL_OR_RETURN(&quantizer_update); |
| 243 if (quantizer_update) | 243 if (quantizer_update) |
| 244 BD_READ_SIGNED_OR_RETURN(7, &shdr->quantizer_update_value[i]); | 244 BD_READ_SIGNED_OR_RETURN(7, &shdr->quantizer_update_value[i]); |
| 245 else |
| 246 shdr->quantizer_update_value[i] = 0; |
| 245 } | 247 } |
| 246 | 248 |
| 247 for (size_t i = 0; i < kMaxMBSegments; ++i) { | 249 for (size_t i = 0; i < kMaxMBSegments; ++i) { |
| 248 bool loop_filter_update; | 250 bool loop_filter_update; |
| 249 BD_READ_BOOL_OR_RETURN(&loop_filter_update); | 251 BD_READ_BOOL_OR_RETURN(&loop_filter_update); |
| 250 if (loop_filter_update) | 252 if (loop_filter_update) |
| 251 BD_READ_SIGNED_OR_RETURN(6, &shdr->lf_update_value[i]); | 253 BD_READ_SIGNED_OR_RETURN(6, &shdr->lf_update_value[i]); |
| 254 else |
| 255 shdr->lf_update_value[i] = 0; |
| 252 } | 256 } |
| 253 } | 257 } |
| 254 | 258 |
| 255 if (shdr->update_mb_segmentation_map) { | 259 if (shdr->update_mb_segmentation_map) { |
| 256 for (size_t i = 0; i < kNumMBFeatureTreeProbs; ++i) { | 260 for (size_t i = 0; i < kNumMBFeatureTreeProbs; ++i) { |
| 257 bool segment_prob_update; | 261 bool segment_prob_update; |
| 258 BD_READ_BOOL_OR_RETURN(&segment_prob_update); | 262 BD_READ_BOOL_OR_RETURN(&segment_prob_update); |
| 259 if (segment_prob_update) | 263 if (segment_prob_update) |
| 260 BD_READ_UNSIGNED_OR_RETURN(8, &shdr->segment_prob[i]); | 264 BD_READ_UNSIGNED_OR_RETURN(8, &shdr->segment_prob[i]); |
| 261 else | 265 else |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 fhdr->dct_partition_sizes[fhdr->num_of_dct_partitions - 1] = bytes_left; | 867 fhdr->dct_partition_sizes[fhdr->num_of_dct_partitions - 1] = bytes_left; |
| 864 | 868 |
| 865 DVLOG(4) << "Control part size: " << fhdr->first_part_size; | 869 DVLOG(4) << "Control part size: " << fhdr->first_part_size; |
| 866 for (size_t i = 0; i < fhdr->num_of_dct_partitions; ++i) | 870 for (size_t i = 0; i < fhdr->num_of_dct_partitions; ++i) |
| 867 DVLOG(4) << "DCT part " << i << " size: " << fhdr->dct_partition_sizes[i]; | 871 DVLOG(4) << "DCT part " << i << " size: " << fhdr->dct_partition_sizes[i]; |
| 868 | 872 |
| 869 return true; | 873 return true; |
| 870 } | 874 } |
| 871 | 875 |
| 872 } // namespace media | 876 } // namespace media |
| OLD | NEW |