40 for (i = 0; i < 4; ++i) {
69 while(i[0]<len || i[1]<len){
70 while (i[0] < len && !(in[ i[0] ] && (in[ i[0] ]->f.reference & sel)))
72 while (i[1] < len && !(in[ i[1] ] && (in[ i[1] ]->f.reference & (sel^3))))
92 best_poc= dir ? INT_MIN : INT_MAX;
95 const int poc= src[i]->
poc;
96 if(((poc > limit) ^ dir) && ((poc < best_poc) ^ dir)){
98 sorted[out_i]= src[i];
101 if(best_poc == (dir ? INT_MIN : INT_MAX))
103 limit= sorted[out_i++]->
poc - dir;
121 for(list= 0; list<2; list++){
129 if(len < h->ref_count[list])
134 if(lens[0] == lens[1] && lens[1] > 1){
143 if(len < h->ref_count[0])
185 int list,
index, pic_structure;
196 for(index=0; ; index++){
202 if(reordering_of_pic_nums_idc==3)
210 if(reordering_of_pic_nums_idc<3){
211 if(reordering_of_pic_nums_idc<2){
220 if(reordering_of_pic_nums_idc == 0) pred-= abs_diff_pic_num;
221 else pred+= abs_diff_pic_num;
250 if (ref && (ref->
f.
reference & pic_structure)) {
263 for(i=index; i+1<h->
ref_count[list]; i++){
267 for(; i >
index; i--){
283 for(index= 0; index < h->
ref_count[list]; index++){
308 field[0].f.linesize[j] <<= 1;
382 assert(i >= 0 && i < h->short_ref_count);
469 for(i = 0; i < 16; i++){
483 for (i = 0; i < n_mmcos; i++) {
484 if (mmco1[i].opcode != mmco2[i].opcode) {
486 mmco1[i].opcode, mmco2[i].opcode, i);
497 int mmco_index = 0, i;
515 }
else if (!first_slice && mmco_index >= 0 &&
519 "Inconsistent MMCO state between slices [%d, %d]\n",
528 int current_ref_assigned=0, err=0;
534 for(i=0; i<mmco_count; i++){
553 switch(mmco[i].opcode){
596 current_ref_assigned=1;
599 assert(mmco[i].long_arg <= 16);
601 for(j = mmco[i].long_arg; j<16; j++){
609 for(j = 0; j < 16; j++) {
623 if (!current_ref_assigned) {
635 "assignment for second field "
636 "in complementary field pair "
637 "(first field is long term)\n");
662 "number of reference frames (%d+%d) exceeds max (%d; probably "
663 "corrupt input), discarding one\n",
668 for (i = 0; i < 16; ++i)
720 "illegal short ref in memory management control "
721 "operation %d\n", mmco);
729 if (long_arg >= 32 ||
734 "illegal long ref in memory management control "
735 "operation %d\n", opcode);
743 "illegal memory management control operation %d\n",
761 if (first_slice && mmco_index != -1) {
763 }
else if (!first_slice && mmco_index >= 0 &&
767 "Inconsistent MMCO state between slices [%d, %d]\n",