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(2); // max_bytes_per_pic_denom |
| 979 packed_sps_.AppendUE(1); // max_bits_per_mb_denom |
| 980 packed_sps_.AppendUE(16); // log2_max_mv_length_horizontal |
| 981 packed_sps_.AppendUE(16); // log2_max_mv_length_vertical |
| 982 |
| 983 // Explicitly set max_num_reorder_frames to 0 to allow the decoder to |
| 984 // output pictures early. |
| 985 packed_sps_.AppendUE(0); // max_num_reorder_frames |
| 986 |
| 987 // The value of max_dec_frame_buffering shall be greater than or equal to |
| 988 // max_num_ref_frames. |
| 989 const unsigned int max_dec_frame_buffering = |
| 990 current_sps_.max_num_ref_frames; |
| 991 packed_sps_.AppendUE(max_dec_frame_buffering); |
976 } | 992 } |
977 | 993 |
978 packed_sps_.FinishNALU(); | 994 packed_sps_.FinishNALU(); |
979 } | 995 } |
980 | 996 |
981 void VaapiVideoEncodeAccelerator::UpdatePPS() { | 997 void VaapiVideoEncodeAccelerator::UpdatePPS() { |
982 memset(¤t_pps_, 0, sizeof(media::H264PPS)); | 998 memset(¤t_pps_, 0, sizeof(media::H264PPS)); |
983 | 999 |
984 current_pps_.seq_parameter_set_id = current_sps_.seq_parameter_set_id; | 1000 current_pps_.seq_parameter_set_id = current_sps_.seq_parameter_set_id; |
985 current_pps_.pic_parameter_set_id = 0; | 1001 current_pps_.pic_parameter_set_id = 0; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1064 } | 1080 } |
1065 | 1081 |
1066 VaapiVideoEncodeAccelerator::EncodeJob::EncodeJob() | 1082 VaapiVideoEncodeAccelerator::EncodeJob::EncodeJob() |
1067 : coded_buffer(VA_INVALID_ID), keyframe(false) { | 1083 : coded_buffer(VA_INVALID_ID), keyframe(false) { |
1068 } | 1084 } |
1069 | 1085 |
1070 VaapiVideoEncodeAccelerator::EncodeJob::~EncodeJob() { | 1086 VaapiVideoEncodeAccelerator::EncodeJob::~EncodeJob() { |
1071 } | 1087 } |
1072 | 1088 |
1073 } // namespace content | 1089 } // namespace content |
OLD | NEW |