typedef struct ENCODE_COMMAND {
int use_external_quantize_index;
int external_quantize_index;
+ int use_external_arf;
+ // A list of binary flags set from the external controller.
+ // Each binary flag indicates whether the frame is an arf or not.
+ const int *external_arf_indexes;
} ENCODE_COMMAND;
typedef struct PARTITION_INFO {
}
}
+// Gets group of picture information from VP9's decision, and update
+// |group_of_picture| accordingly.
+// This is called at the starting of encoding of each group of picture.
static void UpdateGroupOfPicture(const VP9_COMP *cpi, int start_coding_index,
GroupOfPicture *group_of_picture) {
int first_is_key_frame;
num_frames_ = num_frames;
frame_coding_index_ = 0;
// TODO(angirbid): Should we keep a file pointer here or keep the file_path?
+ assert(infile_path != nullptr);
in_file_ = fopen(infile_path, "r");
if (outfile_path != nullptr) {
out_file_ = fopen(outfile_path, "w");
return output_stats;
}
+void SimpleEncode::SetExternalGroupOfPicture(const bool use_external_arf,
+ const int *external_arf_indexes) {
+ impl_ptr_->cpi->encode_command.use_external_arf = use_external_arf;
+ impl_ptr_->cpi->encode_command.external_arf_indexes = external_arf_indexes;
+}
+
void SimpleEncode::StartEncode() {
assert(impl_ptr_->first_pass_stats.size() > 0);
vpx_rational_t frame_rate =
// values. For details, please check FIRSTPASS_STATS in vp9_firstpass.h
std::vector<std::vector<double>> ObserveFirstPassStats();
+ // Sets arf indexes for the video from external input.
+ // The arf index determines whether a frame is arf or not.
+ // Therefore it also determines the group of picture size.
+ // If set, VP9 will use the external arf index to make decision.
+ // This function is called only once before StartEncde().
+ void SetExternalGroupOfPicture(bool use_external_arf,
+ const int *external_arf_indexes);
+
// Initializes the encoder for actual encoding.
// This function should be called after ComputeFirstPassStats().
void StartEncode();