Mercurial > libavcodec.hg
comparison vc1.c @ 6145:ddf5d7fae101 libavcodec
Select scan tables for 8x4 and 4x8 blocks only once.
Patch by Christophe GISQUET ([christophe][gisquet] <whirlpool sign> free <spot> fr)
Thread [PATCH] Determine once and for all zz scan tables to use in VC-1 VLD
author | kostya |
---|---|
date | Mon, 14 Jan 2008 06:10:02 +0000 |
parents | a2b438bcb1d2 |
children | 49a4e4d78692 |
comparison
equal
deleted
inserted
replaced
6144:f0efd4254164 | 6145:ddf5d7fae101 |
---|---|
775 av_log(avctx, AV_LOG_ERROR, "WMV3 Complex Profile is not fully supported\n"); | 775 av_log(avctx, AV_LOG_ERROR, "WMV3 Complex Profile is not fully supported\n"); |
776 } | 776 } |
777 | 777 |
778 if (v->profile == PROFILE_ADVANCED) | 778 if (v->profile == PROFILE_ADVANCED) |
779 { | 779 { |
780 v->zz_8x4 = ff_vc1_adv_progressive_8x4_zz; | |
781 v->zz_4x8 = ff_vc1_adv_progressive_4x8_zz; | |
780 return decode_sequence_header_adv(v, gb); | 782 return decode_sequence_header_adv(v, gb); |
781 } | 783 } |
782 else | 784 else |
783 { | 785 { |
786 v->zz_8x4 = ff_vc1_simple_progressive_8x4_zz; | |
787 v->zz_4x8 = ff_vc1_simple_progressive_4x8_zz; | |
784 v->res_sm = get_bits(gb, 2); //reserved | 788 v->res_sm = get_bits(gb, 2); //reserved |
785 if (v->res_sm) | 789 if (v->res_sm) |
786 { | 790 { |
787 av_log(avctx, AV_LOG_ERROR, | 791 av_log(avctx, AV_LOG_ERROR, |
788 "Reserved RES_SM=%i is forbidden\n", v->res_sm); | 792 "Reserved RES_SM=%i is forbidden\n", v->res_sm); |
2959 while (!last) { | 2963 while (!last) { |
2960 vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2); | 2964 vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2); |
2961 i += skip; | 2965 i += skip; |
2962 if(i > 31) | 2966 if(i > 31) |
2963 break; | 2967 break; |
2964 if(v->profile < PROFILE_ADVANCED) | 2968 idx = v->zz_8x4[i++]+off; |
2965 idx = ff_vc1_simple_progressive_8x4_zz[i++]; | 2969 block[idx] = value * scale; |
2966 else | |
2967 idx = ff_vc1_adv_progressive_8x4_zz[i++]; | |
2968 block[idx + off] = value * scale; | |
2969 if(!v->pquantizer) | 2970 if(!v->pquantizer) |
2970 block[idx + off] += (block[idx + off] < 0) ? -mquant : mquant; | 2971 block[idx] += (block[idx] < 0) ? -mquant : mquant; |
2971 } | 2972 } |
2972 if(!(subblkpat & (1 << (1 - j))) && !skip_block) | 2973 if(!(subblkpat & (1 << (1 - j))) && !skip_block) |
2973 s->dsp.vc1_inv_trans_8x4(dst + j*4*linesize, linesize, block + off); | 2974 s->dsp.vc1_inv_trans_8x4(dst + j*4*linesize, linesize, block + off); |
2974 } | 2975 } |
2975 break; | 2976 break; |
2981 while (!last) { | 2982 while (!last) { |
2982 vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2); | 2983 vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2); |
2983 i += skip; | 2984 i += skip; |
2984 if(i > 31) | 2985 if(i > 31) |
2985 break; | 2986 break; |
2986 if(v->profile < PROFILE_ADVANCED) | 2987 idx = v->zz_4x8[i++]+off; |
2987 idx = ff_vc1_simple_progressive_4x8_zz[i++]; | 2988 block[idx] = value * scale; |
2988 else | |
2989 idx = ff_vc1_adv_progressive_4x8_zz[i++]; | |
2990 block[idx + off] = value * scale; | |
2991 if(!v->pquantizer) | 2989 if(!v->pquantizer) |
2992 block[idx + off] += (block[idx + off] < 0) ? -mquant : mquant; | 2990 block[idx] += (block[idx] < 0) ? -mquant : mquant; |
2993 } | 2991 } |
2994 if(!(subblkpat & (1 << (1 - j))) && !skip_block) | 2992 if(!(subblkpat & (1 << (1 - j))) && !skip_block) |
2995 s->dsp.vc1_inv_trans_4x8(dst + j*4, linesize, block + off); | 2993 s->dsp.vc1_inv_trans_4x8(dst + j*4, linesize, block + off); |
2996 } | 2994 } |
2997 break; | 2995 break; |