History

avcodec/vc1_block: Inline y_dc_scale_table

Andreas Rheinhardt committed 1 year ago

Commit 38e8eef1 parent 8aa08c92 files · +11 −13Browse files

Unified · Split

2 files
  1. libavcodec/vc1_block.c +11 −11
  2. libavcodec/vc1dec.c +0 −2
libavcodec/vc1_block.c+11−11
@@ -417,7 +417,7 @@ static inline int ff_vc1_pred_dc(MpegEncContext *s, int overlap, int pq, int n, · 416 unmodified lines
417 417
418 /* scale predictors if needed */418 /* scale predictors if needed */
419 q1 = FFABS(s->cur_pic.qscale_table[mb_pos]);419 q1 = FFABS(s->cur_pic.qscale_table[mb_pos]);
420 dqscale_index = s->y_dc_scale_table[q1] - 1;420 dqscale_index = ff_wmv3_dc_scale_table[q1] - 1;
421 if (dqscale_index < 0)421 if (dqscale_index < 0)
422 return 0;422 return 0;
423 423
@@ -434,12 +434,12 @@ static inline int ff_vc1_pred_dc(MpegEncContext *s, int overlap, int pq, int n, · 10 unmodified lines
434 if (c_avail && (n != 1 && n != 3)) {434 if (c_avail && (n != 1 && n != 3)) {
435 q2 = FFABS(s->cur_pic.qscale_table[mb_pos - 1]);435 q2 = FFABS(s->cur_pic.qscale_table[mb_pos - 1]);
436 if (q2 && q2 != q1)436 if (q2 && q2 != q1)
437 c = (int)((unsigned)c * s->y_dc_scale_table[q2] * ff_vc1_dqscale[dqscale_index] + 0x20000) >> 18;437 c = (int)((unsigned)c * ff_wmv3_dc_scale_table[q2] * ff_vc1_dqscale[dqscale_index] + 0x20000) >> 18;
438 }438 }
439 if (a_avail && (n != 2 && n != 3)) {439 if (a_avail && (n != 2 && n != 3)) {
440 q2 = FFABS(s->cur_pic.qscale_table[mb_pos - s->mb_stride]);440 q2 = FFABS(s->cur_pic.qscale_table[mb_pos - s->mb_stride]);
441 if (q2 && q2 != q1)441 if (q2 && q2 != q1)
442 a = (int)((unsigned)a * s->y_dc_scale_table[q2] * ff_vc1_dqscale[dqscale_index] + 0x20000) >> 18;442 a = (int)((unsigned)a * ff_wmv3_dc_scale_table[q2] * ff_vc1_dqscale[dqscale_index] + 0x20000) >> 18;
443 }443 }
444 if (a_avail && c_avail && (n != 3)) {444 if (a_avail && c_avail && (n != 3)) {
445 int off = mb_pos;445 int off = mb_pos;
@@ -449,7 +449,7 @@ static inline int ff_vc1_pred_dc(MpegEncContext *s, int overlap, int pq, int n, · 3 unmodified lines
449 off -= s->mb_stride;449 off -= s->mb_stride;
450 q2 = FFABS(s->cur_pic.qscale_table[off]);450 q2 = FFABS(s->cur_pic.qscale_table[off]);
451 if (q2 && q2 != q1)451 if (q2 && q2 != q1)
452 b = (int)((unsigned)b * s->y_dc_scale_table[q2] * ff_vc1_dqscale[dqscale_index] + 0x20000) >> 18;452 b = (int)((unsigned)b * ff_wmv3_dc_scale_table[q2] * ff_vc1_dqscale[dqscale_index] + 0x20000) >> 18;
453 }453 }
454 454
455 if (c_avail && (!a_avail || abs(a - b) <= abs(b - c))) {455 if (c_avail && (!a_avail || abs(a - b) <= abs(b - c))) {
@@ -917,7 +917,7 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n, · 461 unmodified lines
917 quant = av_clip_uintp2(quant, 5);917 quant = av_clip_uintp2(quant, 5);
918 918
919 /* Set DC scale - y and c use the same so we only set y */919 /* Set DC scale - y and c use the same so we only set y */
920 s->y_dc_scale = s->y_dc_scale_table[quant];920 s->y_dc_scale = ff_wmv3_dc_scale_table[quant];
921 921
922 /* Get DC differential */922 /* Get DC differential */
923 dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_vlc[s->dc_table_index][n >= 4],923 dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_vlc[s->dc_table_index][n >= 4],
@@ -1579,7 +1579,7 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) · 655 unmodified lines
1579 GET_MQUANT();1579 GET_MQUANT();
1580 s->cur_pic.qscale_table[mb_pos] = mquant;1580 s->cur_pic.qscale_table[mb_pos] = mquant;
1581 /* Set DC scale - y and c use the same so we only set y */1581 /* Set DC scale - y and c use the same so we only set y */
1582 s->y_dc_scale = s->y_dc_scale_table[FFABS(mquant)];1582 s->y_dc_scale = ff_wmv3_dc_scale_table[FFABS(mquant)];
1583 dst_idx = 0;1583 dst_idx = 0;
1584 for (i = 0; i < 6; i++) {1584 for (i = 0; i < 6; i++) {
1585 v->a_avail = v->c_avail = 0;1585 v->a_avail = v->c_avail = 0;
@@ -1741,7 +1741,7 @@ static int vc1_decode_p_mb_intfi(VC1Context *v) · 155 unmodified lines
1741 GET_MQUANT();1741 GET_MQUANT();
1742 s->cur_pic.qscale_table[mb_pos] = mquant;1742 s->cur_pic.qscale_table[mb_pos] = mquant;
1743 /* Set DC scale - y and c use the same so we only set y */1743 /* Set DC scale - y and c use the same so we only set y */
1744 s->y_dc_scale = s->y_dc_scale_table[FFABS(mquant)];1744 s->y_dc_scale = ff_wmv3_dc_scale_table[FFABS(mquant)];
1745 v->s.ac_pred = v->acpred_plane[mb_pos] = get_bits1(gb);1745 v->s.ac_pred = v->acpred_plane[mb_pos] = get_bits1(gb);
1746 mb_has_coeffs = idx_mbmode & 1;1746 mb_has_coeffs = idx_mbmode & 1;
1747 if (mb_has_coeffs)1747 if (mb_has_coeffs)
@@ -2028,7 +2028,7 @@ static int vc1_decode_b_mb_intfi(VC1Context *v) · 280 unmodified lines
2028 GET_MQUANT();2028 GET_MQUANT();
2029 s->cur_pic.qscale_table[mb_pos] = mquant;2029 s->cur_pic.qscale_table[mb_pos] = mquant;
2030 /* Set DC scale - y and c use the same so we only set y */2030 /* Set DC scale - y and c use the same so we only set y */
2031 s->y_dc_scale = s->y_dc_scale_table[FFABS(mquant)];2031 s->y_dc_scale = ff_wmv3_dc_scale_table[FFABS(mquant)];
2032 v->s.ac_pred = v->acpred_plane[mb_pos] = get_bits1(gb);2032 v->s.ac_pred = v->acpred_plane[mb_pos] = get_bits1(gb);
2033 mb_has_coeffs = idx_mbmode & 1;2033 mb_has_coeffs = idx_mbmode & 1;
2034 if (mb_has_coeffs)2034 if (mb_has_coeffs)
@@ -2228,7 +2228,7 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) · 193 unmodified lines
2228 GET_MQUANT();2228 GET_MQUANT();
2229 s->cur_pic.qscale_table[mb_pos] = mquant;2229 s->cur_pic.qscale_table[mb_pos] = mquant;
2230 /* Set DC scale - y and c use the same so we only set y */2230 /* Set DC scale - y and c use the same so we only set y */
2231 s->y_dc_scale = s->y_dc_scale_table[FFABS(mquant)];2231 s->y_dc_scale = ff_wmv3_dc_scale_table[FFABS(mquant)];
2232 dst_idx = 0;2232 dst_idx = 0;
2233 for (i = 0; i < 6; i++) {2233 for (i = 0; i < 6; i++) {
2234 v->a_avail = v->c_avail = 0;2234 v->a_avail = v->c_avail = 0;
@@ -2550,7 +2550,7 @@ static void vc1_decode_i_blocks(VC1Context *v) · 315 unmodified lines
2550 }2550 }
2551 2551
2552 /* Set DC scale - y and c use the same so we only set y */2552 /* Set DC scale - y and c use the same so we only set y */
2553 s->y_dc_scale = s->y_dc_scale_table[v->pq];2553 s->y_dc_scale = ff_wmv3_dc_scale_table[v->pq];
2554 2554
2555 //do frame decode2555 //do frame decode
2556 s->mb_x = s->mb_y = 0;2556 s->mb_x = s->mb_y = 0;
@@ -2719,7 +2719,7 @@ static int vc1_decode_i_blocks_adv(VC1Context *v) · 162 unmodified lines
2719 2719
2720 s->cur_pic.qscale_table[mb_pos] = mquant;2720 s->cur_pic.qscale_table[mb_pos] = mquant;
2721 /* Set DC scale - y and c use the same so we only set y */2721 /* Set DC scale - y and c use the same so we only set y */
2722 s->y_dc_scale = s->y_dc_scale_table[FFABS(mquant)];2722 s->y_dc_scale = ff_wmv3_dc_scale_table[FFABS(mquant)];
2723 2723
2724 for (k = 0; k < 6; k++) {2724 for (k = 0; k < 6; k++) {
2725 v->mb_type[0][s->block_index[k]] = 1;2725 v->mb_type[0][s->block_index[k]] = 1;
libavcodec/vc1dec.c+0−2
@@ -471,8 +471,6 @@ av_cold int ff_vc1_decode_init(AVCodecContext *avctx) · 470 unmodified lines
471 if (ret < 0)471 if (ret < 0)
472 return ret;472 return ret;
473 473
474 s->y_dc_scale_table = ff_wmv3_dc_scale_table;
475
476 ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable,474 ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable,
477 ff_wmv1_scantable[1]);475 ff_wmv1_scantable[1]);
478 476

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t