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
417417
418418 /* scale predictors if needed */
419419 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;
421421 if (dqscale_index < 0)
422422 return 0;
423423
@@ -434,12 +434,12 @@ static inline int ff_vc1_pred_dc(MpegEncContext *s, int overlap, int pq, int n, · 10 unmodified lines
434434 if (c_avail && (n != 1 && n != 3)) {
435435 q2 = FFABS(s->cur_pic.qscale_table[mb_pos - 1]);
436436 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;
438438 }
439439 if (a_avail && (n != 2 && n != 3)) {
440440 q2 = FFABS(s->cur_pic.qscale_table[mb_pos - s->mb_stride]);
441441 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;
443443 }
444444 if (a_avail && c_avail && (n != 3)) {
445445 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
449449 off -= s->mb_stride;
450450 q2 = FFABS(s->cur_pic.qscale_table[off]);
451451 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;
453453 }
454454
455455 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
917917 quant = av_clip_uintp2(quant, 5);
918918
919919 /* 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];
921921
922922 /* Get DC differential */
923923 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
15791579 GET_MQUANT();
15801580 s->cur_pic.qscale_table[mb_pos] = mquant;
15811581 /* 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)];
15831583 dst_idx = 0;
15841584 for (i = 0; i < 6; i++) {
15851585 v->a_avail = v->c_avail = 0;
@@ -1741,7 +1741,7 @@ static int vc1_decode_p_mb_intfi(VC1Context *v) · 155 unmodified lines
17411741 GET_MQUANT();
17421742 s->cur_pic.qscale_table[mb_pos] = mquant;
17431743 /* 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)];
17451745 v->s.ac_pred = v->acpred_plane[mb_pos] = get_bits1(gb);
17461746 mb_has_coeffs = idx_mbmode & 1;
17471747 if (mb_has_coeffs)
@@ -2028,7 +2028,7 @@ static int vc1_decode_b_mb_intfi(VC1Context *v) · 280 unmodified lines
20282028 GET_MQUANT();
20292029 s->cur_pic.qscale_table[mb_pos] = mquant;
20302030 /* 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)];
20322032 v->s.ac_pred = v->acpred_plane[mb_pos] = get_bits1(gb);
20332033 mb_has_coeffs = idx_mbmode & 1;
20342034 if (mb_has_coeffs)
@@ -2228,7 +2228,7 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) · 193 unmodified lines
22282228 GET_MQUANT();
22292229 s->cur_pic.qscale_table[mb_pos] = mquant;
22302230 /* 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)];
22322232 dst_idx = 0;
22332233 for (i = 0; i < 6; i++) {
22342234 v->a_avail = v->c_avail = 0;
@@ -2550,7 +2550,7 @@ static void vc1_decode_i_blocks(VC1Context *v) · 315 unmodified lines
25502550 }
25512551
25522552 /* 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];
25542554
25552555 //do frame decode
25562556 s->mb_x = s->mb_y = 0;
@@ -2719,7 +2719,7 @@ static int vc1_decode_i_blocks_adv(VC1Context *v) · 162 unmodified lines
27192719
27202720 s->cur_pic.qscale_table[mb_pos] = mquant;
27212721 /* 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)];
27232723
27242724 for (k = 0; k < 6; k++) {
27252725 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
471471 if (ret < 0)
472472 return ret;
473473
474− s->y_dc_scale_table = ff_wmv3_dc_scale_table;
475−
476474 ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable,
477475 ff_wmv1_scantable[1]);
478476

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