Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "content/common/gpu/media/vaapi_video_encode_accelerator.h" | 5 #include "content/common/gpu/media/vaapi_video_encode_accelerator.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
| (...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 965 packed_sps_.AppendBits(5, current_sps_.cpb_removal_delay_length_minus1); | 965 packed_sps_.AppendBits(5, current_sps_.cpb_removal_delay_length_minus1); |
| 966 packed_sps_.AppendBits(5, current_sps_.dpb_output_delay_length_minus1); | 966 packed_sps_.AppendBits(5, current_sps_.dpb_output_delay_length_minus1); |
| 967 packed_sps_.AppendBits(5, current_sps_.time_offset_length); | 967 packed_sps_.AppendBits(5, current_sps_.time_offset_length); |
| 968 } | 968 } |
| 969 | 969 |
| 970 packed_sps_.AppendBool(false); // vcl_hrd_parameters_flag | 970 packed_sps_.AppendBool(false); // vcl_hrd_parameters_flag |
| 971 if (current_sps_.nal_hrd_parameters_present_flag) | 971 if (current_sps_.nal_hrd_parameters_present_flag) |
| 972 packed_sps_.AppendBool(current_sps_.low_delay_hrd_flag); | 972 packed_sps_.AppendBool(current_sps_.low_delay_hrd_flag); |
| 973 | 973 |
| 974 packed_sps_.AppendBool(false); // pic_struct_present_flag | 974 packed_sps_.AppendBool(false); // pic_struct_present_flag |
| 975 packed_sps_.AppendBool(false); // bitstream_restriction_flag | 975 packed_sps_.AppendBool(true); // bitstream_restriction_flag |
| 976 | |
| 977 packed_sps_.AppendBool(false); // motion_vectors_over_pic_boundaries_flag | |
| 978 packed_sps_.AppendUE(0); // max_bytes_per_pic_denom | |
| 979 packed_sps_.AppendUE(0); // max_bits_per_mb_denom | |
|
Pawel Osciak
2015/01/13 13:59:44
I think we probably want to say 2 and 1, respectiv
hshi1
2015/01/13 18:50:19
Done.
| |
| 980 packed_sps_.AppendUE(16); // log2_max_mv_length_horizontal | |
| 981 packed_sps_.AppendUE(16); // log2_max_mv_length_vertical | |
| 982 | |
| 983 // Disable frame reordering. | |
| 984 packed_sps_.AppendUE(0); // max_num_reorder_frames | |
| 985 | |
| 986 // The value of max_dec_frame_buffering shall be greater than or equal to | |
| 987 // max_num_ref_frames. | |
| 988 const unsigned int max_dec_frame_buffering = | |
| 989 current_sps_.max_num_ref_frames; | |
| 990 packed_sps_.AppendUE(max_dec_frame_buffering); | |
| 976 } | 991 } |
| 977 | 992 |
| 978 packed_sps_.FinishNALU(); | 993 packed_sps_.FinishNALU(); |
| 979 } | 994 } |
| 980 | 995 |
| 981 void VaapiVideoEncodeAccelerator::UpdatePPS() { | 996 void VaapiVideoEncodeAccelerator::UpdatePPS() { |
| 982 memset(¤t_pps_, 0, sizeof(media::H264PPS)); | 997 memset(¤t_pps_, 0, sizeof(media::H264PPS)); |
| 983 | 998 |
| 984 current_pps_.seq_parameter_set_id = current_sps_.seq_parameter_set_id; | 999 current_pps_.seq_parameter_set_id = current_sps_.seq_parameter_set_id; |
| 985 current_pps_.pic_parameter_set_id = 0; | 1000 current_pps_.pic_parameter_set_id = 0; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1064 } | 1079 } |
| 1065 | 1080 |
| 1066 VaapiVideoEncodeAccelerator::EncodeJob::EncodeJob() | 1081 VaapiVideoEncodeAccelerator::EncodeJob::EncodeJob() |
| 1067 : coded_buffer(VA_INVALID_ID), keyframe(false) { | 1082 : coded_buffer(VA_INVALID_ID), keyframe(false) { |
| 1068 } | 1083 } |
| 1069 | 1084 |
| 1070 VaapiVideoEncodeAccelerator::EncodeJob::~EncodeJob() { | 1085 VaapiVideoEncodeAccelerator::EncodeJob::~EncodeJob() { |
| 1071 } | 1086 } |
| 1072 | 1087 |
| 1073 } // namespace content | 1088 } // namespace content |
| OLD | NEW |