42 for (i = 0; i < 4; ++i) {
73 while (i[0] < len || i[1] < len) {
74 while (i[0] < len && !(in[i[0]] && (in[i[0]]->reference & sel)))
76 while (i[1] < len && !(in[i[1]] && (in[i[1]]->reference & (sel ^ 3))))
99 best_poc = dir ? INT_MIN : INT_MAX;
101 for (i = 0; i <
len; i++) {
102 const int poc = src[i]->
poc;
103 if (((poc > limit) ^ dir) && ((poc < best_poc) ^ dir)) {
105 sorted[out_i] = src[i];
108 if (best_poc == (dir ? INT_MIN : INT_MAX))
110 limit = sorted[out_i++]->
poc - dir;
129 for (list = 0; list < 2; list++) {
141 if (len < h->ref_count[list])
146 if (lens[0] == lens[1] && lens[1] > 1) {
147 for (i = 0; i < lens[0] &&
165 if (len < h->ref_count[0])
215 int list,
index, pic_structure, i;
220 for (list = 0; list < h->
list_count; list++) {
227 for (index = 0; ; index++) {
233 if (modification_of_pic_nums_idc == 3)
241 switch (modification_of_pic_nums_idc) {
249 "abs_diff_pic_num overflow\n");
253 if (modification_of_pic_nums_idc == 0)
254 pred -= abs_diff_pic_num;
256 pred += abs_diff_pic_num;
281 "long_term_pic_idx overflow\n");
286 if (ref && (ref->
reference & pic_structure)) {
297 "illegal modification_of_pic_nums_idc %u\n",
298 modification_of_pic_nums_idc);
304 "reference picture missing during reorder\n");
307 for (i = index; i + 1 < h->
ref_count[list]; i++) {
312 for (; i >
index; i--) {
323 for (list = 0; list < h->
list_count; list++) {
324 for (index = 0; index < h->
ref_count[list]; index++) {
347 for (list = 0; list < h->
list_count; list++) {
348 for (i = 0; i < h->
ref_count[list]; i++) {
352 for (j = 0; j < 3; j++)
353 field[0].f.linesize[j] <<= 1;
357 for (j = 0; j < 3; j++)
358 field[1].f.data[j] += frame->
f.
linesize[j];
364 for (j = 0; j < 2; j++) {
430 assert(i >= 0 && i < h->short_ref_count);
484 for (i = 0; i < 16; i++) {
528 for (i = 0; i < 16; i++) {
542 for (i = 0; i < n_mmcos; i++) {
543 if (mmco1[i].opcode != mmco2[i].opcode) {
545 mmco1[i].opcode, mmco2[i].opcode, i);
556 int mmco_index = 0, i = 0;
574 }
else if (!first_slice && mmco_index >= 0 &&
578 "Inconsistent MMCO state between slices [%d, %d]\n",
589 int current_ref_assigned = 0, err = 0;
595 for (i = 0; i < mmco_count; i++) {
616 switch (mmco[i].opcode) {
657 for(j=0; j<16; j++) {
673 current_ref_assigned = 1;
676 assert(mmco[i].long_arg <= 16);
678 for (j = mmco[i].long_arg; j < 16; j++) {
686 for (j = 0; j < 16; j++) {
699 if (!current_ref_assigned) {
711 "assignment for second field "
712 "in complementary field pair "
713 "(first field is long term)\n");
739 "number of reference frames (%d+%d) exceeds max (%d; probably "
740 "corrupt input), discarding one\n",
745 for (i = 0; i < 16; ++i)
759 if (pic->invalid_gap) {
814 "illegal short ref in memory management control "
815 "operation %d\n", mmco);
823 if (long_arg >= 32 ||
828 "illegal long ref in memory management control "
829 "operation %d\n", opcode);
837 "illegal memory management control operation %d\n",
855 if (first_slice && mmco_index != -1) {
856 memcpy(h->
mmco, mmco_temp,
sizeof(h->
mmco));
858 }
else if (!first_slice && mmco_index >= 0 &&
862 "Inconsistent MMCO state between slices [%d, %d]\n",