It coincides with the luma values.
Unified · Split
| @@ -354,8 +354,7 @@ static inline int vc1_i_pred_dc(MpegEncContext *s, int overlap, int pq, int n, · 353 unmodified lines | ||
| 354 | 354 | }; |
| 355 | 355 | |
| 356 | 356 | /* find prediction - wmv3_dc_scale always used here in fact */ |
| 357 | − if (n < 4) scale = s->y_dc_scale; | |
| 358 | − else scale = s->c_dc_scale; | |
| 357 | + scale = s->y_dc_scale; | |
| 359 | 358 | |
| 360 | 359 | wrap = s->block_wrap[n]; |
| 361 | 360 | dc_val = s->dc_val[0] + s->block_index[n]; |
| @@ -611,11 +610,7 @@ static int vc1_decode_i_block(VC1Context *v, int16_t block[64], int n, · 249 unmodified lines | ||
| 611 | 610 | *dc_val = dcdiff; |
| 612 | 611 | |
| 613 | 612 | /* Store the quantized DC coeff, used for prediction */ |
| 614 | − if (n < 4) | |
| 615 | − scale = s->y_dc_scale; | |
| 616 | − else | |
| 617 | − scale = s->c_dc_scale; | |
| 618 | − block[0] = dcdiff * scale; | |
| 613 | + block[0] = dcdiff * s->y_dc_scale; | |
| 619 | 614 | |
| 620 | 615 | ac_val = s->ac_val[0][s->block_index[n]]; |
| 621 | 616 | ac_val2 = ac_val; |
| @@ -752,11 +747,7 @@ static int vc1_decode_i_block_adv(VC1Context *v, int16_t block[64], int n, · 130 unmodified lines | ||
| 752 | 747 | *dc_val = dcdiff; |
| 753 | 748 | |
| 754 | 749 | /* Store the quantized DC coeff, used for prediction */ |
| 755 | − if (n < 4) | |
| 756 | − scale = s->y_dc_scale; | |
| 757 | − else | |
| 758 | − scale = s->c_dc_scale; | |
| 759 | − block[0] = dcdiff * scale; | |
| 750 | + block[0] = dcdiff * s->y_dc_scale; | |
| 760 | 751 | |
| 761 | 752 | /* check if AC is needed at all */ |
| 762 | 753 | if (!a_avail && !c_avail) |
| @@ -925,9 +916,8 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n, · 162 unmodified lines | ||
| 925 | 916 | /* XXX: Guard against dumb values of mquant */ |
| 926 | 917 | quant = av_clip_uintp2(quant, 5); |
| 927 | 918 | |
| 928 | − /* Set DC scale - y and c use the same */ | |
| 919 | + /* Set DC scale - y and c use the same so we only set y */ | |
| 929 | 920 | s->y_dc_scale = s->y_dc_scale_table[quant]; |
| 930 | − s->c_dc_scale = s->c_dc_scale_table[quant]; | |
| 931 | 921 | |
| 932 | 922 | /* Get DC differential */ |
| 933 | 923 | dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_vlc[s->dc_table_index][n >= 4], |
| @@ -949,12 +939,7 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n, · 15 unmodified lines | ||
| 949 | 939 | *dc_val = dcdiff; |
| 950 | 940 | |
| 951 | 941 | /* Store the quantized DC coeff, used for prediction */ |
| 952 | − | |
| 953 | − if (n < 4) { | |
| 954 | − block[0] = dcdiff * s->y_dc_scale; | |
| 955 | − } else { | |
| 956 | − block[0] = dcdiff * s->c_dc_scale; | |
| 957 | − } | |
| 942 | + block[0] = dcdiff * s->y_dc_scale; | |
| 958 | 943 | |
| 959 | 944 | //AC Decoding |
| 960 | 945 | i = 1; |
| @@ -1593,9 +1578,8 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) · 632 unmodified lines | ||
| 1593 | 1578 | v->s.ac_pred = v->acpred_plane[mb_pos] = get_bits1(gb); |
| 1594 | 1579 | GET_MQUANT(); |
| 1595 | 1580 | s->cur_pic.qscale_table[mb_pos] = mquant; |
| 1596 | − /* Set DC scale - y and c use the same (not sure if necessary here) */ | |
| 1581 | + /* Set DC scale - y and c use the same so we only set y */ | |
| 1597 | 1582 | s->y_dc_scale = s->y_dc_scale_table[FFABS(mquant)]; |
| 1598 | − s->c_dc_scale = s->c_dc_scale_table[FFABS(mquant)]; | |
| 1599 | 1583 | dst_idx = 0; |
| 1600 | 1584 | for (i = 0; i < 6; i++) { |
| 1601 | 1585 | v->a_avail = v->c_avail = 0; |
| @@ -1756,9 +1740,8 @@ static int vc1_decode_p_mb_intfi(VC1Context *v) · 154 unmodified lines | ||
| 1756 | 1740 | s->cur_pic.mb_type[mb_pos + v->mb_off] = MB_TYPE_INTRA; |
| 1757 | 1741 | GET_MQUANT(); |
| 1758 | 1742 | s->cur_pic.qscale_table[mb_pos] = mquant; |
| 1759 | − /* Set DC scale - y and c use the same (not sure if necessary here) */ | |
| 1743 | + /* Set DC scale - y and c use the same so we only set y */ | |
| 1760 | 1744 | s->y_dc_scale = s->y_dc_scale_table[FFABS(mquant)]; |
| 1761 | − s->c_dc_scale = s->c_dc_scale_table[FFABS(mquant)]; | |
| 1762 | 1745 | v->s.ac_pred = v->acpred_plane[mb_pos] = get_bits1(gb); |
| 1763 | 1746 | mb_has_coeffs = idx_mbmode & 1; |
| 1764 | 1747 | if (mb_has_coeffs) |
| @@ -2044,9 +2027,8 @@ static int vc1_decode_b_mb_intfi(VC1Context *v) · 279 unmodified lines | ||
| 2044 | 2027 | s->cur_pic.mb_type[mb_pos + v->mb_off] = MB_TYPE_INTRA; |
| 2045 | 2028 | GET_MQUANT(); |
| 2046 | 2029 | s->cur_pic.qscale_table[mb_pos] = mquant; |
| 2047 | − /* Set DC scale - y and c use the same (not sure if necessary here) */ | |
| 2030 | + /* Set DC scale - y and c use the same so we only set y */ | |
| 2048 | 2031 | s->y_dc_scale = s->y_dc_scale_table[FFABS(mquant)]; |
| 2049 | − s->c_dc_scale = s->c_dc_scale_table[FFABS(mquant)]; | |
| 2050 | 2032 | v->s.ac_pred = v->acpred_plane[mb_pos] = get_bits1(gb); |
| 2051 | 2033 | mb_has_coeffs = idx_mbmode & 1; |
| 2052 | 2034 | if (mb_has_coeffs) |
| @@ -2245,9 +2227,8 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) · 192 unmodified lines | ||
| 2245 | 2227 | v->s.ac_pred = v->acpred_plane[mb_pos] = get_bits1(gb); |
| 2246 | 2228 | GET_MQUANT(); |
| 2247 | 2229 | s->cur_pic.qscale_table[mb_pos] = mquant; |
| 2248 | − /* Set DC scale - y and c use the same (not sure if necessary here) */ | |
| 2230 | + /* Set DC scale - y and c use the same so we only set y */ | |
| 2249 | 2231 | s->y_dc_scale = s->y_dc_scale_table[FFABS(mquant)]; |
| 2250 | − s->c_dc_scale = s->c_dc_scale_table[FFABS(mquant)]; | |
| 2251 | 2232 | dst_idx = 0; |
| 2252 | 2233 | for (i = 0; i < 6; i++) { |
| 2253 | 2234 | v->a_avail = v->c_avail = 0; |
| @@ -2568,9 +2549,8 @@ static void vc1_decode_i_blocks(VC1Context *v) · 314 unmodified lines | ||
| 2568 | 2549 | break; |
| 2569 | 2550 | } |
| 2570 | 2551 | |
| 2571 | − /* Set DC scale - y and c use the same */ | |
| 2552 | + /* Set DC scale - y and c use the same so we only set y */ | |
| 2572 | 2553 | s->y_dc_scale = s->y_dc_scale_table[v->pq]; |
| 2573 | − s->c_dc_scale = s->c_dc_scale_table[v->pq]; | |
| 2574 | 2554 | |
| 2575 | 2555 | //do frame decode |
| 2576 | 2556 | s->mb_x = s->mb_y = 0; |
| @@ -2738,9 +2718,8 @@ static int vc1_decode_i_blocks_adv(VC1Context *v) · 161 unmodified lines | ||
| 2738 | 2718 | GET_MQUANT(); |
| 2739 | 2719 | |
| 2740 | 2720 | s->cur_pic.qscale_table[mb_pos] = mquant; |
| 2741 | − /* Set DC scale - y and c use the same */ | |
| 2721 | + /* Set DC scale - y and c use the same so we only set y */ | |
| 2742 | 2722 | s->y_dc_scale = s->y_dc_scale_table[FFABS(mquant)]; |
| 2743 | − s->c_dc_scale = s->c_dc_scale_table[FFABS(mquant)]; | |
| 2744 | 2723 | |
| 2745 | 2724 | for (k = 0; k < 6; k++) { |
| 2746 | 2725 | v->mb_type[0][s->block_index[k]] = 1; |
| @@ -472,7 +472,6 @@ av_cold int ff_vc1_decode_init(AVCodecContext *avctx) · 471 unmodified lines | ||
| 472 | 472 | return ret; |
| 473 | 473 | |
| 474 | 474 | s->y_dc_scale_table = ff_wmv3_dc_scale_table; |
| 475 | − s->c_dc_scale_table = ff_wmv3_dc_scale_table; | |
| 476 | 475 | |
| 477 | 476 | ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, |
| 478 | 477 | ff_wmv1_scantable[1]); |