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

Side by Side Diff: webrtc/common_video/h264/pps_parser.cc

Issue 2373393002: Support for parsing CABAC coded bitstreams (Closed)
Patch Set: Created 4 years, 2 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 | « webrtc/common_video/h264/pps_parser.h ('k') | webrtc/common_video/h264/pps_parser_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 rtc::BitBuffer* bit_buffer) { 75 rtc::BitBuffer* bit_buffer) {
76 PpsState pps; 76 PpsState pps;
77 77
78 RETURN_EMPTY_ON_FAIL(ParsePpsIdsInternal(bit_buffer, &pps.id, &pps.sps_id)); 78 RETURN_EMPTY_ON_FAIL(ParsePpsIdsInternal(bit_buffer, &pps.id, &pps.sps_id));
79 79
80 uint32_t bits_tmp; 80 uint32_t bits_tmp;
81 uint32_t golomb_ignored; 81 uint32_t golomb_ignored;
82 // entropy_coding_mode_flag: u(1) 82 // entropy_coding_mode_flag: u(1)
83 uint32_t entropy_coding_mode_flag; 83 uint32_t entropy_coding_mode_flag;
84 RETURN_EMPTY_ON_FAIL(bit_buffer->ReadBits(&entropy_coding_mode_flag, 1)); 84 RETURN_EMPTY_ON_FAIL(bit_buffer->ReadBits(&entropy_coding_mode_flag, 1));
85 // TODO(pbos): Implement CABAC support if spotted in the wild. 85 pps.entropy_coding_mode_flag = !!entropy_coding_mode_flag;
magjed_webrtc 2016/09/28 15:13:01 nit: !! is cute, but I would prefer != 0. I don't
86 RTC_CHECK(entropy_coding_mode_flag == 0)
87 << "Don't know how to parse CABAC streams.";
88 // bottom_field_pic_order_in_frame_present_flag: u(1) 86 // bottom_field_pic_order_in_frame_present_flag: u(1)
89 uint32_t bottom_field_pic_order_in_frame_present_flag; 87 uint32_t bottom_field_pic_order_in_frame_present_flag;
90 RETURN_EMPTY_ON_FAIL( 88 RETURN_EMPTY_ON_FAIL(
91 bit_buffer->ReadBits(&bottom_field_pic_order_in_frame_present_flag, 1)); 89 bit_buffer->ReadBits(&bottom_field_pic_order_in_frame_present_flag, 1));
92 pps.bottom_field_pic_order_in_frame_present_flag = 90 pps.bottom_field_pic_order_in_frame_present_flag =
93 bottom_field_pic_order_in_frame_present_flag != 0; 91 bottom_field_pic_order_in_frame_present_flag != 0;
94 92
95 // num_slice_groups_minus1: ue(v) 93 // num_slice_groups_minus1: ue(v)
96 uint32_t num_slice_groups_minus1; 94 uint32_t num_slice_groups_minus1;
97 RETURN_EMPTY_ON_FAIL( 95 RETURN_EMPTY_ON_FAIL(
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 // pic_parameter_set_id: ue(v) 182 // pic_parameter_set_id: ue(v)
185 if (!bit_buffer->ReadExponentialGolomb(pps_id)) 183 if (!bit_buffer->ReadExponentialGolomb(pps_id))
186 return false; 184 return false;
187 // seq_parameter_set_id: ue(v) 185 // seq_parameter_set_id: ue(v)
188 if (!bit_buffer->ReadExponentialGolomb(sps_id)) 186 if (!bit_buffer->ReadExponentialGolomb(sps_id))
189 return false; 187 return false;
190 return true; 188 return true;
191 } 189 }
192 190
193 } // namespace webrtc 191 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/common_video/h264/pps_parser.h ('k') | webrtc/common_video/h264/pps_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698