static void find_arf_order(GF_GROUP *gf_group, int *layer_depth,
int *index_counter, int depth, int start, int end) {
- const int mid = (start + end + 1) >> 1;
+ const int mid = (start + end) >> 1;
const int min_frame_interval = 3;
// Process regular P frames
- if (end - start <= min_frame_interval) {
+ if (end - start < min_frame_interval) {
int idx;
for (idx = start; idx < end; ++idx) {
gf_group->update_type[*index_counter] = LF_UPDATE;
return;
}
- assert(abs(mid - start) > 1 && abs(mid - end) > 1);
+ assert(abs(mid - start) >= 1 && abs(mid - end) >= 1);
// Process ARF frame
layer_depth[*index_counter] = depth;