History

VC1: don't use vc1_put_block() in vc1_decode_i_blocks_adv().

Advanced profile never uses "range reduction", so vc1_put_block() quite literally just calls put_pixels_clamped() from vc1_decode_i_blocks_adv(). By inlining the function, we can prevent calling IDCT8x8 if CODEC_FLAG_GRAY is set, and we don't have to scale the coeffs in the [0,256] range, but can instead use put_signed_pixels_clamped(). (cherry picked from commit 70aa916e4630bcec14439a2d703074b6d4c890a8)

Ronald S. Bultje committed 15 years ago

Commit a8858ee1 parent cdeba2d1 file · +11 −3Browse files

Unified · Split

libavcodec/vc1dec.c+11−3
@@ -2704,7 +2704,7 @@ static void vc1_decode_i_blocks(VC1Context *v) · 2703 unmodified lines
27042704 */
27052705 static void vc1_decode_i_blocks_adv(VC1Context *v)
27062706 {
2707− int k, j;
2707+ int k;
27082708 MpegEncContext *s = &v->s;
27092709 int cbp, val;
27102710 uint8_t *coded_val;
@@ -2747,7 +2747,14 @@ static void vc1_decode_i_blocks_adv(VC1Context *v) · 36 unmodified lines
27472747 s->mb_x = 0;
27482748 ff_init_block_index(s);
27492749 for(;s->mb_x < s->mb_width; s->mb_x++) {
2750+ uint8_t *dst[6];
27502751 ff_update_block_index(s);
2752+ dst[0] = s->dest[0];
2753+ dst[1] = dst[0] + 8;
2754+ dst[2] = s->dest[0] + s->linesize * 8;
2755+ dst[3] = dst[2] + 8;
2756+ dst[4] = s->dest[1];
2757+ dst[5] = s->dest[2];
27512758 s->dsp.clear_blocks(s->block[0]);
27522759 mb_pos = s->mb_x + s->mb_y * s->mb_stride;
27532760 s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA;
@@ -2791,11 +2798,12 @@ static void vc1_decode_i_blocks_adv(VC1Context *v) · 37 unmodified lines
27912798
27922799 vc1_decode_i_block_adv(v, s->block[k], k, val, (k<4)? v->codingset : v->codingset2, mquant);
27932800
2801+ if (k > 3 && (s->flags & CODEC_FLAG_GRAY)) continue;
27942802 v->vc1dsp.vc1_inv_trans_8x8(s->block[k]);
2795− for(j = 0; j < 64; j++) s->block[k][j] += 128;
2803+ s->dsp.put_signed_pixels_clamped(s->block[k], dst[k],
2804+ k & 4 ? s->uvlinesize : s->linesize);
27962805 }
27972806
2798− vc1_put_block(v, s->block);
27992807 if(overlap) {
28002808 if(s->mb_x) {
28012809 v->vc1dsp.vc1_h_overlap(s->dest[0], s->linesize);

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