41 for (i = 0; i < 4; ++i) {
70 while(i[0]<len || i[1]<len){
71 while (i[0] < len && !(in[ i[0] ] && (in[ i[0] ]->f.reference & sel)))
73 while (i[1] < len && !(in[ i[1] ] && (in[ i[1] ]->f.reference & (sel^3))))
93 best_poc= dir ? INT_MIN : INT_MAX;
96 const int poc= src[i]->
poc;
97 if(((poc > limit) ^ dir) && ((poc < best_poc) ^ dir)){
99 sorted[out_i]= src[i];
102 if(best_poc == (dir ? INT_MIN : INT_MAX))
104 limit= sorted[out_i++]->
poc - dir;
123 for(list= 0; list<2; list++){
131 if(len < h->ref_count[list])
136 if(lens[0] == lens[1] && lens[1] > 1){
145 if(len < h->ref_count[0])
190 int list,
index, pic_structure;
201 for(index=0; ; index++){
207 if(reordering_of_pic_nums_idc==3)
215 if(reordering_of_pic_nums_idc<3){
216 if(reordering_of_pic_nums_idc<2){
225 if(reordering_of_pic_nums_idc == 0) pred-= abs_diff_pic_num;
226 else pred+= abs_diff_pic_num;
255 if (ref && (ref->
f.
reference & pic_structure)) {
268 for(i=index; i+1<h->
ref_count[list]; i++){
272 for(; i >
index; i--){
288 for(index= 0; index < h->
ref_count[list]; index++){
313 field[0].f.linesize[j] <<= 1;
388 assert(i >= 0 && i < h->short_ref_count);
476 for(i = 0; i < 16; i++){
490 for (i = 0; i < n_mmcos; i++) {
491 if (mmco1[i].opcode != mmco2[i].opcode)
502 int mmco_index = 0, i;
521 }
else if (!first_slice && mmco_index >= 0 &&
525 "Inconsistent MMCO state between slices [%d, %d, %d]\n",
535 int current_ref_assigned=0, err=0;
541 for(i=0; i<mmco_count; i++){
560 switch(mmco[i].opcode){
603 current_ref_assigned=1;
606 assert(mmco[i].long_arg <= 16);
608 for(j = mmco[i].long_arg; j<16; j++){
616 for(j = 0; j < 16; j++) {
630 if (!current_ref_assigned) {
642 "assignment for second field "
643 "in complementary field pair "
644 "(first field is long term)\n");
669 "number of reference frames (%d+%d) exceeds max (%d; probably "
670 "corrupt input), discarding one\n",
675 for (i = 0; i < 16; ++i)
728 "illegal short ref in memory management control "
729 "operation %d\n", mmco);
737 if (long_arg >= 32 ||
742 "illegal long ref in memory management control "
743 "operation %d\n", opcode);
751 "illegal memory management control operation %d\n",
769 if (first_slice && mmco_index != -1) {
771 }
else if (!first_slice && mmco_index >= 0 &&
775 "Inconsistent MMCO state between slices [%d, %d, %d]\n",