It is only used by the mpegvideo unquantize functions which this decoder does not use at all.
Unified · Split
| @@ -585,7 +585,6 @@ static int vc1_decode_i_block(VC1Context *v, int16_t block[64], int n, · 584 unmodified lines | ||
| 585 | 585 | GetBitContext *gb = &v->s.gb; |
| 586 | 586 | MpegEncContext *s = &v->s; |
| 587 | 587 | int dc_pred_dir = 0; /* Direction of the DC prediction used */ |
| 588 | − int i; | |
| 589 | 588 | int16_t *dc_val; |
| 590 | 589 | int16_t *ac_val, *ac_val2; |
| 591 | 590 | int dcdiff, scale; |
| @@ -622,7 +621,6 @@ static int vc1_decode_i_block(VC1Context *v, int16_t block[64], int n, · 30 unmodified lines | ||
| 622 | 621 | scale = v->pq * 2 + v->halfpq; |
| 623 | 622 | |
| 624 | 623 | //AC Decoding |
| 625 | − i = !!coded; | |
| 626 | 624 | |
| 627 | 625 | if (coded) { |
| 628 | 626 | int last = 0, skip, value; |
| @@ -637,14 +635,14 @@ static int vc1_decode_i_block(VC1Context *v, int16_t block[64], int n, · 8 unmodified lines | ||
| 637 | 635 | } else |
| 638 | 636 | zz_table = v->zz_8x8[1]; |
| 639 | 637 | |
| 640 | − while (!last) { | |
| 638 | + for (int i = 1; !last; ++i) { | |
| 641 | 639 | int ret = vc1_decode_ac_coeff(v, &last, &skip, &value, codingset); |
| 642 | 640 | if (ret < 0) |
| 643 | 641 | return ret; |
| 644 | 642 | i += skip; |
| 645 | 643 | if (i > 63) |
| 646 | 644 | break; |
| 647 | − block[zz_table[i++]] = value; | |
| 645 | + block[zz_table[i]] = value; | |
| 648 | 646 | } |
| 649 | 647 | |
| 650 | 648 | /* apply AC prediction if needed */ |
| @@ -696,8 +694,6 @@ static int vc1_decode_i_block(VC1Context *v, int16_t block[64], int n, · 45 unmodified lines | ||
| 696 | 694 | } |
| 697 | 695 | } |
| 698 | 696 | } |
| 699 | − if (s->ac_pred) i = 63; | |
| 700 | − s->block_last_index[n] = i; | |
| 701 | 697 | |
| 702 | 698 | return 0; |
| 703 | 699 | } |
| @@ -716,7 +712,6 @@ static int vc1_decode_i_block_adv(VC1Context *v, int16_t block[64], int n, · 12 unmodified lines | ||
| 716 | 712 | GetBitContext *gb = &v->s.gb; |
| 717 | 713 | MpegEncContext *s = &v->s; |
| 718 | 714 | int dc_pred_dir = 0; /* Direction of the DC prediction used */ |
| 719 | − int i; | |
| 720 | 715 | int16_t *dc_val = NULL; |
| 721 | 716 | int16_t *ac_val, *ac_val2; |
| 722 | 717 | int dcdiff; |
| @@ -778,7 +773,6 @@ static int vc1_decode_i_block_adv(VC1Context *v, int16_t block[64], int n, · 55 unmodified lines | ||
| 778 | 773 | } |
| 779 | 774 | |
| 780 | 775 | //AC Decoding |
| 781 | − i = 1; | |
| 782 | 776 | |
| 783 | 777 | if (coded) { |
| 784 | 778 | int last = 0, skip, value; |
| @@ -801,14 +795,14 @@ static int vc1_decode_i_block_adv(VC1Context *v, int16_t block[64], int n, · 16 unmodified lines | ||
| 801 | 795 | zz_table = v->zzi_8x8; |
| 802 | 796 | } |
| 803 | 797 | |
| 804 | − while (!last) { | |
| 798 | + for (int i = 1; !last; ++i) { | |
| 805 | 799 | int ret = vc1_decode_ac_coeff(v, &last, &skip, &value, codingset); |
| 806 | 800 | if (ret < 0) |
| 807 | 801 | return ret; |
| 808 | 802 | i += skip; |
| 809 | 803 | if (i > 63) |
| 810 | 804 | break; |
| 811 | − block[zz_table[i++]] = value; | |
| 805 | + block[zz_table[i]] = value; | |
| 812 | 806 | } |
| 813 | 807 | |
| 814 | 808 | /* apply AC prediction if needed */ |
| @@ -880,8 +874,6 @@ static int vc1_decode_i_block_adv(VC1Context *v, int16_t block[64], int n, · 65 unmodified lines | ||
| 880 | 874 | } |
| 881 | 875 | } |
| 882 | 876 | } |
| 883 | − if (use_pred) i = 63; | |
| 884 | − s->block_last_index[n] = i; | |
| 885 | 877 | |
| 886 | 878 | return 0; |
| 887 | 879 | } |
| @@ -900,7 +892,6 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n, · 12 unmodified lines | ||
| 900 | 892 | GetBitContext *gb = &v->s.gb; |
| 901 | 893 | MpegEncContext *s = &v->s; |
| 902 | 894 | int dc_pred_dir = 0; /* Direction of the DC prediction used */ |
| 903 | − int i; | |
| 904 | 895 | int16_t *dc_val = NULL; |
| 905 | 896 | int16_t *ac_val, *ac_val2; |
| 906 | 897 | int dcdiff; |
| @@ -942,7 +933,6 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n, · 35 unmodified lines | ||
| 942 | 933 | block[0] = dcdiff * s->y_dc_scale; |
| 943 | 934 | |
| 944 | 935 | //AC Decoding |
| 945 | − i = 1; | |
| 946 | 936 | |
| 947 | 937 | /* check if AC is needed at all and adjust direction if needed */ |
| 948 | 938 | if (!a_avail) dc_pred_dir = 1; |
| @@ -973,7 +963,7 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n, · 24 unmodified lines | ||
| 973 | 963 | int last = 0, skip, value; |
| 974 | 964 | int k; |
| 975 | 965 | |
| 976 | − while (!last) { | |
| 966 | + for (int i = 1; !last; ++i) { | |
| 977 | 967 | int ret = vc1_decode_ac_coeff(v, &last, &skip, &value, codingset); |
| 978 | 968 | if (ret < 0) |
| 979 | 969 | return ret; |
| @@ -981,15 +971,15 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n, · 1 unmodified line | ||
| 981 | 971 | if (i > 63) |
| 982 | 972 | break; |
| 983 | 973 | if (v->fcm == PROGRESSIVE) |
| 984 | − block[v->zz_8x8[0][i++]] = value; | |
| 974 | + block[v->zz_8x8[0][i]] = value; | |
| 985 | 975 | else { |
| 986 | 976 | if (use_pred && (v->fcm == ILACE_FRAME)) { |
| 987 | 977 | if (!dc_pred_dir) // top |
| 988 | − block[v->zz_8x8[2][i++]] = value; | |
| 978 | + block[v->zz_8x8[2][i]] = value; | |
| 989 | 979 | else // left |
| 990 | − block[v->zz_8x8[3][i++]] = value; | |
| 980 | + block[v->zz_8x8[3][i]] = value; | |
| 991 | 981 | } else { |
| 992 | − block[v->zzi_8x8[i++]] = value; | |
| 982 | + block[v->zzi_8x8[i]] = value; | |
| 993 | 983 | } |
| 994 | 984 | } |
| 995 | 985 | } |
| @@ -1033,8 +1023,6 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n, · 37 unmodified lines | ||
| 1033 | 1023 | if (!v->pquantizer) |
| 1034 | 1024 | block[k] += (block[k] < 0) ? -quant : quant; |
| 1035 | 1025 | } |
| 1036 | − | |
| 1037 | − if (use_pred) i = 63; | |
| 1038 | 1026 | } else { // no AC coeffs |
| 1039 | 1027 | int k; |
| 1040 | 1028 | |
| @@ -1082,10 +1070,8 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n, · 41 unmodified lines | ||
| 1082 | 1070 | block[k << v->top_blk_sh] += (block[k << v->top_blk_sh] < 0) ? -quant : quant; |
| 1083 | 1071 | } |
| 1084 | 1072 | } |
| 1085 | − i = 63; | |
| 1086 | 1073 | } |
| 1087 | 1074 | } |
| 1088 | − s->block_last_index[n] = i; | |
| 1089 | 1075 | |
| 1090 | 1076 | return 0; |
| 1091 | 1077 | } |