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

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/vc1dec.c+11−3
@@ -2704,7 +2704,7 @@ static void vc1_decode_i_blocks(VC1Context *v) · 2703 unmodified lines
2704 */2704 */
2705static void vc1_decode_i_blocks_adv(VC1Context *v)2705static void vc1_decode_i_blocks_adv(VC1Context *v)
2706{2706{
2707 int k, j;2707 int k;
2708 MpegEncContext *s = &v->s;2708 MpegEncContext *s = &v->s;
2709 int cbp, val;2709 int cbp, val;
2710 uint8_t *coded_val;2710 uint8_t *coded_val;
@@ -2747,7 +2747,14 @@ static void vc1_decode_i_blocks_adv(VC1Context *v) · 36 unmodified lines
2747 s->mb_x = 0;2747 s->mb_x = 0;
2748 ff_init_block_index(s);2748 ff_init_block_index(s);
2749 for(;s->mb_x < s->mb_width; s->mb_x++) {2749 for(;s->mb_x < s->mb_width; s->mb_x++) {
2750 uint8_t *dst[6];
2750 ff_update_block_index(s);2751 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];
2751 s->dsp.clear_blocks(s->block[0]);2758 s->dsp.clear_blocks(s->block[0]);
2752 mb_pos = s->mb_x + s->mb_y * s->mb_stride;2759 mb_pos = s->mb_x + s->mb_y * s->mb_stride;
2753 s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA;2760 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
2791 2798
2792 vc1_decode_i_block_adv(v, s->block[k], k, val, (k<4)? v->codingset : v->codingset2, mquant);2799 vc1_decode_i_block_adv(v, s->block[k], k, val, (k<4)? v->codingset : v->codingset2, mquant);
2793 2800
2801 if (k > 3 && (s->flags & CODEC_FLAG_GRAY)) continue;
2794 v->vc1dsp.vc1_inv_trans_8x8(s->block[k]);2802 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);
2796 }2805 }
2797 2806
2798 vc1_put_block(v, s->block);
2799 if(overlap) {2807 if(overlap) {
2800 if(s->mb_x) {2808 if(s->mb_x) {
2801 v->vc1dsp.vc1_h_overlap(s->dest[0], s->linesize);2809 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