37 #define COPY_PICTURE(dst, src) \
40 (dst)->f.extended_data = (dst)->f.data;\
41 (dst)->tf.f = &(dst)->f;\
47 for (i = 0; i < 4; ++i) {
77 while (i[0] < len || i[1] < len) {
78 while (i[0] < len && !(in[i[0]] && (in[i[0]]->reference & sel)))
80 while (i[1] < len && !(in[i[1]] && (in[i[1]]->reference & (sel ^ 3))))
101 best_poc = dir ? INT_MIN : INT_MAX;
103 for (i = 0; i <
len; i++) {
104 const int poc = src[i]->
poc;
105 if (((poc > limit) ^ dir) && ((poc < best_poc) ^ dir)) {
107 sorted[out_i] = src[i];
110 if (best_poc == (dir ? INT_MIN : INT_MAX))
112 limit = sorted[out_i++]->
poc - dir;
131 for (list = 0; list < 2; list++) {
139 if (len < h->ref_count[list])
144 if (lens[0] == lens[1] && lens[1] > 1) {
157 if (len < h->ref_count[0])
207 int list,
index, pic_structure, i;
212 for (list = 0; list < h->
list_count; list++) {
219 for (index = 0; ; index++) {
225 if (reordering_of_pic_nums_idc == 3)
233 if (reordering_of_pic_nums_idc < 3) {
234 if (reordering_of_pic_nums_idc < 2) {
243 if (reordering_of_pic_nums_idc == 0)
244 pred -= abs_diff_pic_num;
246 pred += abs_diff_pic_num;
273 if (ref && (ref->
reference & pic_structure)) {
286 for (i = index; i + 1 < h->
ref_count[list]; i++) {
291 for (; i >
index; i--) {
306 for (list = 0; list < h->
list_count; list++) {
307 for (index = 0; index < h->
ref_count[list]; index++) {
330 for (list = 0; list < h->
list_count; list++) {
331 for (i = 0; i < h->
ref_count[list]; i++) {
335 for (j = 0; j < 3; j++)
336 field[0].f.linesize[j] <<= 1;
340 for (j = 0; j < 3; j++)
341 field[1].f.data[j] += frame->
f.
linesize[j];
347 for (j = 0; j < 2; j++) {
413 assert(i >= 0 && i < h->short_ref_count);
467 for (i = 0; i < 16; i++) {
506 for (i = 0; i < 16; i++) {
520 for (i = 0; i < n_mmcos; i++) {
521 if (mmco1[i].opcode != mmco2[i].opcode) {
523 mmco1[i].opcode, mmco2[i].opcode, i);
534 int mmco_index = 0, i;
552 }
else if (!first_slice && mmco_index >= 0 &&
556 "Inconsistent MMCO state between slices [%d, %d]\n",
566 int current_ref_assigned = 0, err = 0;
572 for (i = 0; i < mmco_count; i++) {
593 switch (mmco[i].opcode) {
630 for(j=0; j<16; j++) {
649 current_ref_assigned = 1;
652 assert(mmco[i].long_arg <= 16);
654 for (j = mmco[i].long_arg; j < 16; j++) {
662 for (j = 0; j < 16; j++) {
675 if (!current_ref_assigned) {
687 "assignment for second field "
688 "in complementary field pair "
689 "(first field is long term)\n");
715 "number of reference frames (%d+%d) exceeds max (%d; probably "
716 "corrupt input), discarding one\n",
721 for (i = 0; i < 16; ++i)
773 "illegal short ref in memory management control "
774 "operation %d\n", mmco);
782 if (long_arg >= 32 ||
787 "illegal long ref in memory management control "
788 "operation %d\n", opcode);
796 "illegal memory management control operation %d\n",
814 if (first_slice && mmco_index != -1) {
815 memcpy(h->
mmco, mmco_temp,
sizeof(h->
mmco));
817 }
else if (!first_slice && mmco_index >= 0 &&
821 "Inconsistent MMCO state between slices [%d, %d]\n",