head 1.4; access; symbols pkgsrc-2013Q2:1.4.0.4 pkgsrc-2013Q2-base:1.4 pkgsrc-2012Q4:1.4.0.2 pkgsrc-2012Q4-base:1.4 pkgsrc-2011Q4:1.3.0.44 pkgsrc-2011Q4-base:1.3 pkgsrc-2011Q3:1.3.0.42 pkgsrc-2011Q3-base:1.3 pkgsrc-2011Q2:1.3.0.40 pkgsrc-2011Q2-base:1.3 pkgsrc-2011Q1:1.3.0.38 pkgsrc-2011Q1-base:1.3 pkgsrc-2010Q4:1.3.0.36 pkgsrc-2010Q4-base:1.3 pkgsrc-2010Q3:1.3.0.34 pkgsrc-2010Q3-base:1.3 pkgsrc-2010Q2:1.3.0.32 pkgsrc-2010Q2-base:1.3 pkgsrc-2010Q1:1.3.0.30 pkgsrc-2010Q1-base:1.3 pkgsrc-2009Q4:1.3.0.28 pkgsrc-2009Q4-base:1.3 pkgsrc-2009Q3:1.3.0.26 pkgsrc-2009Q3-base:1.3 pkgsrc-2009Q2:1.3.0.24 pkgsrc-2009Q2-base:1.3 pkgsrc-2009Q1:1.3.0.22 pkgsrc-2009Q1-base:1.3 pkgsrc-2008Q4:1.3.0.20 pkgsrc-2008Q4-base:1.3 pkgsrc-2008Q3:1.3.0.18 pkgsrc-2008Q3-base:1.3 cube-native-xorg:1.3.0.16 cube-native-xorg-base:1.3 pkgsrc-2008Q2:1.3.0.14 pkgsrc-2008Q2-base:1.3 cwrapper:1.3.0.12 pkgsrc-2008Q1:1.3.0.10 pkgsrc-2008Q1-base:1.3 pkgsrc-2007Q4:1.3.0.8 pkgsrc-2007Q4-base:1.3 pkgsrc-2007Q3:1.3.0.6 pkgsrc-2007Q3-base:1.3 pkgsrc-2007Q2:1.3.0.4 pkgsrc-2007Q2-base:1.3 pkgsrc-2007Q1:1.3.0.2 pkgsrc-2007Q1-base:1.3 pkgsrc-2006Q4:1.2.0.2 pkgsrc-2006Q4-base:1.2 pkgsrc-2006Q3:1.1.0.2 pkgsrc-2006Q3-base:1.1; locks; strict; comment @# @; 1.4 date 2012.03.21.16.37.15; author drochner; state dead; branches; next 1.3; 1.3 date 2007.02.07.20.04.00; author drochner; state Exp; branches; next 1.2; 1.2 date 2006.12.08.09.24.26; author abs; state Exp; branches; next 1.1; 1.1 date 2006.08.14.12.15.38; author joerg; state Exp; branches 1.1.2.1; next ; 1.1.2.1 date 2006.12.09.09.13.15; author salo; state Exp; branches; next ; desc @@ 1.4 log @update to 1.2.1 changes: -Rewrite of VDPAU OSD handling -sndio plugin is now buildable -Various bug fixes @ text @$NetBSD: patch-da,v 1.3 2007/02/07 20:04:00 drochner Exp $ Move some inlined functions to a place before they are used, otherwise GCC barfs when -fno-unit-a-time is active. --- src/libffmpeg/libavcodec/h263.c.orig 2007-01-28 19:38:33.000000000 +0100 +++ src/libffmpeg/libavcodec/h263.c @@@@ -3459,6 +3459,53 @@@@ static inline int get_amv(MpegEncContext } /** + * decodes the dc value. + * @@param n block index (0-3 are luma, 4-5 are chroma) + * @@param dir_ptr the prediction direction will be stored here + * @@return the quantized dc + */ +static inline int mpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr) +{ + int level, code; + + if (n < 4) + code = get_vlc2(&s->gb, dc_lum.table, DC_VLC_BITS, 1); + else + code = get_vlc2(&s->gb, dc_chrom.table, DC_VLC_BITS, 1); + if (code < 0 || code > 9 /* && s->nbit<9 */){ + av_log(s->avctx, AV_LOG_ERROR, "illegal dc vlc\n"); + return -1; + } + if (code == 0) { + level = 0; + } else { + if(IS_3IV1){ + if(code==1) + level= 2*get_bits1(&s->gb)-1; + else{ + if(get_bits1(&s->gb)) + level = get_bits(&s->gb, code-1) + (1<<(code-1)); + else + level = -get_bits(&s->gb, code-1) - (1<<(code-1)); + } + }else{ + level = get_xbits(&s->gb, code); + } + + if (code > 8){ + if(get_bits1(&s->gb)==0){ /* marker */ + if(s->error_resilience>=2){ + av_log(s->avctx, AV_LOG_ERROR, "dc marker bit missing\n"); + return -1; + } + } + } + } + + return ff_mpeg4_pred_dc(s, n, level, dir_ptr, 0); +} + +/** * decodes first partition. * @@return number of MBs decoded or <0 if an error occured */ @@@@ -3764,124 +3811,380 @@@@ int ff_mpeg4_decode_partitions(MpegEncCo } /** - * decode partition C of one MB. + * decodes a block. * @@return <0 if an error occured */ -static int mpeg4_decode_partitioned_mb(MpegEncContext *s, DCTELEM block[6][64]) +static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block, + int n, int coded, int intra, int rvlc) { - int cbp, mb_type; - const int xy= s->mb_x + s->mb_y*s->mb_stride; - - mb_type= s->current_picture.mb_type[xy]; - cbp = s->cbp_table[xy]; + int level, i, last, run; + int dc_pred_dir; + RLTable * rl; + RL_VLC_ELEM * rl_vlc; + const uint8_t * scan_table; + int qmul, qadd; - s->use_intra_dc_vlc= s->qscale < s->intra_dc_threshold; + //Note intra & rvlc should be optimized away if this is inlined - if(s->current_picture.qscale_table[xy] != s->qscale){ - ff_set_qscale(s, s->current_picture.qscale_table[xy] ); - } + if(intra) { + if(s->use_intra_dc_vlc){ + /* DC coef */ + if(s->partitioned_frame){ + level = s->dc_val[0][ s->block_index[n] ]; + if(n<4) level= FASTDIV((level + (s->y_dc_scale>>1)), s->y_dc_scale); + else level= FASTDIV((level + (s->c_dc_scale>>1)), s->c_dc_scale); + dc_pred_dir= (s->pred_dir_table[s->mb_x + s->mb_y*s->mb_stride]<pict_type == P_TYPE || s->pict_type==S_TYPE) { - int i; - for(i=0; i<4; i++){ - s->mv[0][i][0] = s->current_picture.motion_val[0][ s->block_index[i] ][0]; - s->mv[0][i][1] = s->current_picture.motion_val[0][ s->block_index[i] ][1]; + if(rvlc){ + rl = &rvlc_rl_intra; + rl_vlc = rvlc_rl_intra.rl_vlc[0]; + }else{ + rl = &rl_intra; + rl_vlc = rl_intra.rl_vlc[0]; } - s->mb_intra = IS_INTRA(mb_type); + if (s->ac_pred) { + if (dc_pred_dir == 0) + scan_table = s->intra_v_scantable.permutated; /* left */ + else + scan_table = s->intra_h_scantable.permutated; /* top */ + } else { + scan_table = s->intra_scantable.permutated; + } + qmul=1; + qadd=0; + } else { + i = -1; + if (!coded) { + s->block_last_index[n] = i; + return 0; + } + if(rvlc) rl = &rvlc_rl_inter; + else rl = &rl_inter; - if (IS_SKIP(mb_type)) { - /* skip mb */ - for(i=0;i<6;i++) - s->block_last_index[i] = -1; - s->mv_dir = MV_DIR_FORWARD; - s->mv_type = MV_TYPE_16X16; - if(s->pict_type==S_TYPE && s->vol_sprite_usage==GMC_SPRITE){ - s->mcsel=1; - s->mb_skipped = 0; + scan_table = s->intra_scantable.permutated; + + if(s->mpeg_quant){ + qmul=1; + qadd=0; + if(rvlc){ + rl_vlc = rvlc_rl_inter.rl_vlc[0]; }else{ - s->mcsel=0; - s->mb_skipped = 1; + rl_vlc = rl_inter.rl_vlc[0]; } - }else if(s->mb_intra){ - s->ac_pred = IS_ACPRED(s->current_picture.mb_type[xy]); - }else if(!s->mb_intra){ -// s->mcsel= 0; //FIXME do we need to init that - - s->mv_dir = MV_DIR_FORWARD; - if (IS_8X8(mb_type)) { - s->mv_type = MV_TYPE_8X8; - } else { - s->mv_type = MV_TYPE_16X16; + }else{ + qmul = s->qscale << 1; + qadd = (s->qscale - 1) | 1; + if(rvlc){ + rl_vlc = rvlc_rl_inter.rl_vlc[s->qscale]; + }else{ + rl_vlc = rl_inter.rl_vlc[s->qscale]; } } - } else { /* I-Frame */ - s->mb_intra = 1; - s->ac_pred = IS_ACPRED(s->current_picture.mb_type[xy]); } + { + OPEN_READER(re, &s->gb); + for(;;) { + UPDATE_CACHE(re, &s->gb); + GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 0); + if (level==0) { + /* escape */ + if(rvlc){ + if(SHOW_UBITS(re, &s->gb, 1)==0){ + av_log(s->avctx, AV_LOG_ERROR, "1. marker bit missing in rvlc esc\n"); + return -1; + }; SKIP_CACHE(re, &s->gb, 1); - if (!IS_SKIP(mb_type)) { - int i; - s->dsp.clear_blocks(s->block[0]); - /* decode each block */ - for (i = 0; i < 6; i++) { - if(mpeg4_decode_block(s, block[i], i, cbp&32, s->mb_intra, s->rvlc) < 0){ - av_log(s->avctx, AV_LOG_ERROR, "texture corrupted at %d %d %d\n", s->mb_x, s->mb_y, s->mb_intra); - return -1; - } - cbp+=cbp; - } - } + last= SHOW_UBITS(re, &s->gb, 1); SKIP_CACHE(re, &s->gb, 1); + run= SHOW_UBITS(re, &s->gb, 6); LAST_SKIP_CACHE(re, &s->gb, 6); + SKIP_COUNTER(re, &s->gb, 1+1+6); + UPDATE_CACHE(re, &s->gb); - /* per-MB end of slice check */ + if(SHOW_UBITS(re, &s->gb, 1)==0){ + av_log(s->avctx, AV_LOG_ERROR, "2. marker bit missing in rvlc esc\n"); + return -1; + }; SKIP_CACHE(re, &s->gb, 1); - if(--s->mb_num_left <= 0){ -//printf("%06X %d\n", show_bits(&s->gb, 24), s->gb.size_in_bits - get_bits_count(&s->gb)); - if(mpeg4_is_resync(s)) - return SLICE_END; - else - return SLICE_NOEND; - }else{ - if(mpeg4_is_resync(s)){ - const int delta= s->mb_x + 1 == s->mb_width ? 2 : 1; - if(s->cbp_table[xy+delta]) - return SLICE_END; - } - return SLICE_OK; - } -} + level= SHOW_UBITS(re, &s->gb, 11); SKIP_CACHE(re, &s->gb, 11); -/** - * read the next MVs for OBMC. yes this is a ugly hack, feel free to send a patch :) - */ -static void preview_obmc(MpegEncContext *s){ - GetBitContext gb= s->gb; + if(SHOW_UBITS(re, &s->gb, 5)!=0x10){ + av_log(s->avctx, AV_LOG_ERROR, "reverse esc missing\n"); + return -1; + }; SKIP_CACHE(re, &s->gb, 5); - int cbpc, i, pred_x, pred_y, mx, my; - int16_t *mot_val; - const int xy= s->mb_x + 1 + s->mb_y * s->mb_stride; - const int stride= s->b8_stride*2; + level= level * qmul + qadd; + level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1); LAST_SKIP_CACHE(re, &s->gb, 1); + SKIP_COUNTER(re, &s->gb, 1+11+5+1); - for(i=0; i<4; i++) - s->block_index[i]+= 2; - for(i=4; i<6; i++) - s->block_index[i]+= 1; - s->mb_x++; + i+= run + 1; + if(last) i+=192; + }else{ + int cache; + cache= GET_CACHE(re, &s->gb); - assert(s->pict_type == P_TYPE); + if(IS_3IV1) + cache ^= 0xC0000000; - do{ - if (get_bits1(&s->gb)) { - /* skip mb */ - mot_val = s->current_picture.motion_val[0][ s->block_index[0] ]; - mot_val[0 ]= mot_val[2 ]= - mot_val[0+stride]= mot_val[2+stride]= 0; - mot_val[1 ]= mot_val[3 ]= - mot_val[1+stride]= mot_val[3+stride]= 0; + if (cache&0x80000000) { + if (cache&0x40000000) { + /* third escape */ + SKIP_CACHE(re, &s->gb, 2); + last= SHOW_UBITS(re, &s->gb, 1); SKIP_CACHE(re, &s->gb, 1); + run= SHOW_UBITS(re, &s->gb, 6); LAST_SKIP_CACHE(re, &s->gb, 6); + SKIP_COUNTER(re, &s->gb, 2+1+6); + UPDATE_CACHE(re, &s->gb); - s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; - goto end; - } - cbpc = get_vlc2(&s->gb, inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2); + if(IS_3IV1){ + level= SHOW_SBITS(re, &s->gb, 12); LAST_SKIP_BITS(re, &s->gb, 12); + }else{ + if(SHOW_UBITS(re, &s->gb, 1)==0){ + av_log(s->avctx, AV_LOG_ERROR, "1. marker bit missing in 3. esc\n"); + return -1; + }; SKIP_CACHE(re, &s->gb, 1); + + level= SHOW_SBITS(re, &s->gb, 12); SKIP_CACHE(re, &s->gb, 12); + + if(SHOW_UBITS(re, &s->gb, 1)==0){ + av_log(s->avctx, AV_LOG_ERROR, "2. marker bit missing in 3. esc\n"); + return -1; + }; LAST_SKIP_CACHE(re, &s->gb, 1); + + SKIP_COUNTER(re, &s->gb, 1+12+1); + } + +#if 0 + if(s->error_resilience >= FF_ER_COMPLIANT){ + const int abs_level= FFABS(level); + if(abs_level<=MAX_LEVEL && run<=MAX_RUN){ + const int run1= run - rl->max_run[last][abs_level] - 1; + if(abs_level <= rl->max_level[last][run]){ + av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, vlc encoding possible\n"); + return -1; + } + if(s->error_resilience > FF_ER_COMPLIANT){ + if(abs_level <= rl->max_level[last][run]*2){ + av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, esc 1 encoding possible\n"); + return -1; + } + if(run1 >= 0 && abs_level <= rl->max_level[last][run1]){ + av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, esc 2 encoding possible\n"); + return -1; + } + } + } + } +#endif + if (level>0) level= level * qmul + qadd; + else level= level * qmul - qadd; + + if((unsigned)(level + 2048) > 4095){ + if(s->error_resilience > FF_ER_COMPLIANT){ + if(level > 2560 || level<-2560){ + av_log(s->avctx, AV_LOG_ERROR, "|level| overflow in 3. esc, qp=%d\n", s->qscale); + return -1; + } + } + level= level<0 ? -2048 : 2047; + } + + i+= run + 1; + if(last) i+=192; + } else { + /* second escape */ +#if MIN_CACHE_BITS < 20 + LAST_SKIP_BITS(re, &s->gb, 2); + UPDATE_CACHE(re, &s->gb); +#else + SKIP_BITS(re, &s->gb, 2); +#endif + GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 1); + i+= run + rl->max_run[run>>7][level/qmul] +1; //FIXME opt indexing + level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1); + LAST_SKIP_BITS(re, &s->gb, 1); + } + } else { + /* first escape */ +#if MIN_CACHE_BITS < 19 + LAST_SKIP_BITS(re, &s->gb, 1); + UPDATE_CACHE(re, &s->gb); +#else + SKIP_BITS(re, &s->gb, 1); +#endif + GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 1); + i+= run; + level = level + rl->max_level[run>>7][(run-1)&63] * qmul;//FIXME opt indexing + level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1); + LAST_SKIP_BITS(re, &s->gb, 1); + } + } + } else { + i+= run; + level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1); + LAST_SKIP_BITS(re, &s->gb, 1); + } + if (i > 62){ + i-= 192; + if(i&(~63)){ + av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y); + return -1; + } + + block[scan_table[i]] = level; + break; + } + + block[scan_table[i]] = level; + } + CLOSE_READER(re, &s->gb); + } + not_coded: + if (intra) { + if(!s->use_intra_dc_vlc){ + block[0] = ff_mpeg4_pred_dc(s, n, block[0], &dc_pred_dir, 0); + + i -= i>>31; //if(i == -1) i=0; + } + + mpeg4_pred_ac(s, block, n, dc_pred_dir); + if (s->ac_pred) { + i = 63; /* XXX: not optimal */ + } + } + s->block_last_index[n] = i; + return 0; +} + +/** + * decode partition C of one MB. + * @@return <0 if an error occured + */ +static int mpeg4_decode_partitioned_mb(MpegEncContext *s, DCTELEM block[6][64]) +{ + int cbp, mb_type; + const int xy= s->mb_x + s->mb_y*s->mb_stride; + + mb_type= s->current_picture.mb_type[xy]; + cbp = s->cbp_table[xy]; + + s->use_intra_dc_vlc= s->qscale < s->intra_dc_threshold; + + if(s->current_picture.qscale_table[xy] != s->qscale){ + ff_set_qscale(s, s->current_picture.qscale_table[xy] ); + } + + if (s->pict_type == P_TYPE || s->pict_type==S_TYPE) { + int i; + for(i=0; i<4; i++){ + s->mv[0][i][0] = s->current_picture.motion_val[0][ s->block_index[i] ][0]; + s->mv[0][i][1] = s->current_picture.motion_val[0][ s->block_index[i] ][1]; + } + s->mb_intra = IS_INTRA(mb_type); + + if (IS_SKIP(mb_type)) { + /* skip mb */ + for(i=0;i<6;i++) + s->block_last_index[i] = -1; + s->mv_dir = MV_DIR_FORWARD; + s->mv_type = MV_TYPE_16X16; + if(s->pict_type==S_TYPE && s->vol_sprite_usage==GMC_SPRITE){ + s->mcsel=1; + s->mb_skipped = 0; + }else{ + s->mcsel=0; + s->mb_skipped = 1; + } + }else if(s->mb_intra){ + s->ac_pred = IS_ACPRED(s->current_picture.mb_type[xy]); + }else if(!s->mb_intra){ +// s->mcsel= 0; //FIXME do we need to init that + + s->mv_dir = MV_DIR_FORWARD; + if (IS_8X8(mb_type)) { + s->mv_type = MV_TYPE_8X8; + } else { + s->mv_type = MV_TYPE_16X16; + } + } + } else { /* I-Frame */ + s->mb_intra = 1; + s->ac_pred = IS_ACPRED(s->current_picture.mb_type[xy]); + } + + if (!IS_SKIP(mb_type)) { + int i; + s->dsp.clear_blocks(s->block[0]); + /* decode each block */ + for (i = 0; i < 6; i++) { + if(mpeg4_decode_block(s, block[i], i, cbp&32, s->mb_intra, s->rvlc) < 0){ + av_log(s->avctx, AV_LOG_ERROR, "texture corrupted at %d %d %d\n", s->mb_x, s->mb_y, s->mb_intra); + return -1; + } + cbp+=cbp; + } + } + + /* per-MB end of slice check */ + + if(--s->mb_num_left <= 0){ +//printf("%06X %d\n", show_bits(&s->gb, 24), s->gb.size_in_bits - get_bits_count(&s->gb)); + if(mpeg4_is_resync(s)) + return SLICE_END; + else + return SLICE_NOEND; + }else{ + if(mpeg4_is_resync(s)){ + const int delta= s->mb_x + 1 == s->mb_width ? 2 : 1; + if(s->cbp_table[xy+delta]) + return SLICE_END; + } + return SLICE_OK; + } +} + +/** + * read the next MVs for OBMC. yes this is a ugly hack, feel free to send a patch :) + */ +static void preview_obmc(MpegEncContext *s){ + GetBitContext gb= s->gb; + + int cbpc, i, pred_x, pred_y, mx, my; + int16_t *mot_val; + const int xy= s->mb_x + 1 + s->mb_y * s->mb_stride; + const int stride= s->b8_stride*2; + + for(i=0; i<4; i++) + s->block_index[i]+= 2; + for(i=4; i<6; i++) + s->block_index[i]+= 1; + s->mb_x++; + + assert(s->pict_type == P_TYPE); + + do{ + if (get_bits1(&s->gb)) { + /* skip mb */ + mot_val = s->current_picture.motion_val[0][ s->block_index[0] ]; + mot_val[0 ]= mot_val[2 ]= + mot_val[0+stride]= mot_val[2+stride]= 0; + mot_val[1 ]= mot_val[3 ]= + mot_val[1+stride]= mot_val[3+stride]= 0; + + s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; + goto end; + } + cbpc = get_vlc2(&s->gb, inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2); }while(cbpc == 20); if(cbpc & 4){ @@@@ -4747,309 +5050,6 @@@@ not_coded: return 0; } -/** - * decodes the dc value. - * @@param n block index (0-3 are luma, 4-5 are chroma) - * @@param dir_ptr the prediction direction will be stored here - * @@return the quantized dc - */ -static inline int mpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr) -{ - int level, code; - - if (n < 4) - code = get_vlc2(&s->gb, dc_lum.table, DC_VLC_BITS, 1); - else - code = get_vlc2(&s->gb, dc_chrom.table, DC_VLC_BITS, 1); - if (code < 0 || code > 9 /* && s->nbit<9 */){ - av_log(s->avctx, AV_LOG_ERROR, "illegal dc vlc\n"); - return -1; - } - if (code == 0) { - level = 0; - } else { - if(IS_3IV1){ - if(code==1) - level= 2*get_bits1(&s->gb)-1; - else{ - if(get_bits1(&s->gb)) - level = get_bits(&s->gb, code-1) + (1<<(code-1)); - else - level = -get_bits(&s->gb, code-1) - (1<<(code-1)); - } - }else{ - level = get_xbits(&s->gb, code); - } - - if (code > 8){ - if(get_bits1(&s->gb)==0){ /* marker */ - if(s->error_resilience>=2){ - av_log(s->avctx, AV_LOG_ERROR, "dc marker bit missing\n"); - return -1; - } - } - } - } - - return ff_mpeg4_pred_dc(s, n, level, dir_ptr, 0); -} - -/** - * decodes a block. - * @@return <0 if an error occured - */ -static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block, - int n, int coded, int intra, int rvlc) -{ - int level, i, last, run; - int dc_pred_dir; - RLTable * rl; - RL_VLC_ELEM * rl_vlc; - const uint8_t * scan_table; - int qmul, qadd; - - //Note intra & rvlc should be optimized away if this is inlined - - if(intra) { - if(s->use_intra_dc_vlc){ - /* DC coef */ - if(s->partitioned_frame){ - level = s->dc_val[0][ s->block_index[n] ]; - if(n<4) level= FASTDIV((level + (s->y_dc_scale>>1)), s->y_dc_scale); - else level= FASTDIV((level + (s->c_dc_scale>>1)), s->c_dc_scale); - dc_pred_dir= (s->pred_dir_table[s->mb_x + s->mb_y*s->mb_stride]<ac_pred) { - if (dc_pred_dir == 0) - scan_table = s->intra_v_scantable.permutated; /* left */ - else - scan_table = s->intra_h_scantable.permutated; /* top */ - } else { - scan_table = s->intra_scantable.permutated; - } - qmul=1; - qadd=0; - } else { - i = -1; - if (!coded) { - s->block_last_index[n] = i; - return 0; - } - if(rvlc) rl = &rvlc_rl_inter; - else rl = &rl_inter; - - scan_table = s->intra_scantable.permutated; - - if(s->mpeg_quant){ - qmul=1; - qadd=0; - if(rvlc){ - rl_vlc = rvlc_rl_inter.rl_vlc[0]; - }else{ - rl_vlc = rl_inter.rl_vlc[0]; - } - }else{ - qmul = s->qscale << 1; - qadd = (s->qscale - 1) | 1; - if(rvlc){ - rl_vlc = rvlc_rl_inter.rl_vlc[s->qscale]; - }else{ - rl_vlc = rl_inter.rl_vlc[s->qscale]; - } - } - } - { - OPEN_READER(re, &s->gb); - for(;;) { - UPDATE_CACHE(re, &s->gb); - GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 0); - if (level==0) { - /* escape */ - if(rvlc){ - if(SHOW_UBITS(re, &s->gb, 1)==0){ - av_log(s->avctx, AV_LOG_ERROR, "1. marker bit missing in rvlc esc\n"); - return -1; - }; SKIP_CACHE(re, &s->gb, 1); - - last= SHOW_UBITS(re, &s->gb, 1); SKIP_CACHE(re, &s->gb, 1); - run= SHOW_UBITS(re, &s->gb, 6); LAST_SKIP_CACHE(re, &s->gb, 6); - SKIP_COUNTER(re, &s->gb, 1+1+6); - UPDATE_CACHE(re, &s->gb); - - if(SHOW_UBITS(re, &s->gb, 1)==0){ - av_log(s->avctx, AV_LOG_ERROR, "2. marker bit missing in rvlc esc\n"); - return -1; - }; SKIP_CACHE(re, &s->gb, 1); - - level= SHOW_UBITS(re, &s->gb, 11); SKIP_CACHE(re, &s->gb, 11); - - if(SHOW_UBITS(re, &s->gb, 5)!=0x10){ - av_log(s->avctx, AV_LOG_ERROR, "reverse esc missing\n"); - return -1; - }; SKIP_CACHE(re, &s->gb, 5); - - level= level * qmul + qadd; - level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1); LAST_SKIP_CACHE(re, &s->gb, 1); - SKIP_COUNTER(re, &s->gb, 1+11+5+1); - - i+= run + 1; - if(last) i+=192; - }else{ - int cache; - cache= GET_CACHE(re, &s->gb); - - if(IS_3IV1) - cache ^= 0xC0000000; - - if (cache&0x80000000) { - if (cache&0x40000000) { - /* third escape */ - SKIP_CACHE(re, &s->gb, 2); - last= SHOW_UBITS(re, &s->gb, 1); SKIP_CACHE(re, &s->gb, 1); - run= SHOW_UBITS(re, &s->gb, 6); LAST_SKIP_CACHE(re, &s->gb, 6); - SKIP_COUNTER(re, &s->gb, 2+1+6); - UPDATE_CACHE(re, &s->gb); - - if(IS_3IV1){ - level= SHOW_SBITS(re, &s->gb, 12); LAST_SKIP_BITS(re, &s->gb, 12); - }else{ - if(SHOW_UBITS(re, &s->gb, 1)==0){ - av_log(s->avctx, AV_LOG_ERROR, "1. marker bit missing in 3. esc\n"); - return -1; - }; SKIP_CACHE(re, &s->gb, 1); - - level= SHOW_SBITS(re, &s->gb, 12); SKIP_CACHE(re, &s->gb, 12); - - if(SHOW_UBITS(re, &s->gb, 1)==0){ - av_log(s->avctx, AV_LOG_ERROR, "2. marker bit missing in 3. esc\n"); - return -1; - }; LAST_SKIP_CACHE(re, &s->gb, 1); - - SKIP_COUNTER(re, &s->gb, 1+12+1); - } - -#if 0 - if(s->error_resilience >= FF_ER_COMPLIANT){ - const int abs_level= FFABS(level); - if(abs_level<=MAX_LEVEL && run<=MAX_RUN){ - const int run1= run - rl->max_run[last][abs_level] - 1; - if(abs_level <= rl->max_level[last][run]){ - av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, vlc encoding possible\n"); - return -1; - } - if(s->error_resilience > FF_ER_COMPLIANT){ - if(abs_level <= rl->max_level[last][run]*2){ - av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, esc 1 encoding possible\n"); - return -1; - } - if(run1 >= 0 && abs_level <= rl->max_level[last][run1]){ - av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, esc 2 encoding possible\n"); - return -1; - } - } - } - } -#endif - if (level>0) level= level * qmul + qadd; - else level= level * qmul - qadd; - - if((unsigned)(level + 2048) > 4095){ - if(s->error_resilience > FF_ER_COMPLIANT){ - if(level > 2560 || level<-2560){ - av_log(s->avctx, AV_LOG_ERROR, "|level| overflow in 3. esc, qp=%d\n", s->qscale); - return -1; - } - } - level= level<0 ? -2048 : 2047; - } - - i+= run + 1; - if(last) i+=192; - } else { - /* second escape */ -#if MIN_CACHE_BITS < 20 - LAST_SKIP_BITS(re, &s->gb, 2); - UPDATE_CACHE(re, &s->gb); -#else - SKIP_BITS(re, &s->gb, 2); -#endif - GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 1); - i+= run + rl->max_run[run>>7][level/qmul] +1; //FIXME opt indexing - level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1); - LAST_SKIP_BITS(re, &s->gb, 1); - } - } else { - /* first escape */ -#if MIN_CACHE_BITS < 19 - LAST_SKIP_BITS(re, &s->gb, 1); - UPDATE_CACHE(re, &s->gb); -#else - SKIP_BITS(re, &s->gb, 1); -#endif - GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 1); - i+= run; - level = level + rl->max_level[run>>7][(run-1)&63] * qmul;//FIXME opt indexing - level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1); - LAST_SKIP_BITS(re, &s->gb, 1); - } - } - } else { - i+= run; - level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1); - LAST_SKIP_BITS(re, &s->gb, 1); - } - if (i > 62){ - i-= 192; - if(i&(~63)){ - av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y); - return -1; - } - - block[scan_table[i]] = level; - break; - } - - block[scan_table[i]] = level; - } - CLOSE_READER(re, &s->gb); - } - not_coded: - if (intra) { - if(!s->use_intra_dc_vlc){ - block[0] = ff_mpeg4_pred_dc(s, n, block[0], &dc_pred_dir, 0); - - i -= i>>31; //if(i == -1) i=0; - } - - mpeg4_pred_ac(s, block, n, dc_pred_dir); - if (s->ac_pred) { - i = 63; /* XXX: not optimal */ - } - } - s->block_last_index[n] = i; - return 0; -} - /* most is hardcoded. should extend to handle all h263 streams */ int h263_decode_picture_header(MpegEncContext *s) { @ 1.3 log @update to 1.1.4 changes: This release contains improvements and important bugfixes. Some issues that have really "bugged" us for quite some time (like NTSC DVDs audio sync, broken since 1.1.2, and H.264 crashes) are finally fixed. Some of the new features include True Audio and WavPack support. bugfixes, cleanup etc pkgsrc notes: -new True Audio / WavPack support is not enabled yet -cleanup of bl3.mk: no need to propagate internals -removed dependency on libflac -- there is support to play flac files internally -removed build of plugins for more exotic video outputs (SDL, ImageMagick, GL, aalib), this might be built in extra pkgs (like esound and arts already do) @ text @d1 1 a1 1 $NetBSD$ @ 1.2 log @Update xine-lib to 1.1.3 * Security fixes: - Heap overflow in libmms (related to CVE-2006-2200) - Buffer overrun in Real Media input plugin. [bug #1603458] Thanks to Roland Kay for reporting and JW for the patch. * Update build system to support x86 Darwin setups, and merge patches to support Darwin OS better. * Replace custom ALSA check with pkg-config check, and make sure 0.9.0 is the requried version. * When the compiler supports it, enable hidden visibility for all the plugins to export only the plugin info entry (and eventual needed special functions), to replace the min-symtab option that wasn't working. * Add "m4b" to the list of supported file extensions for the Qt demuxer, to allow playing (unprotected) audiobooks in AAC format. * Remove --disable-fpic hack, prefer using --without-pic instead. * Add new output plugin: PulseAudio (based on PolypAudio plugin), that uses 0.9 API (PulseAudio is PolypAudio renamed). * Remove PolypAudio plugin, latest version supported 0.7 API that is no more supported by upstream, and it's replaced by PulseAudio. * Allow 0 for DVD title/chapter (navigation or full title). * New experimental JACK audio driver. * Fix switch from alsa/dmix 2.0 to 5.1 [bug #1226595] * Don't use proxy for localhost connection. [bug #1553633] * Use mmap() to open local files if available. * Use pkg-config to look for external FFmpeg. * Allow FFmpeg to play MP3s in case MAD is not present. * Reduce the dead time when trying to connect to dead hosts, by falling back to non-blocking sockets on the last address found for an host, and allowing users to provide a connection timeout. [bug #1550844] * Return the correct error message to frontends when a file is inaccessible or the network connection is broken. [bug #1550763] * Support libcaca 0.99, thanks to cjacker huang. * Fix crash on video-only WMV streams. [bug #1564598] * Report audio stream on Shorten files (required for Amarok to play them). * Optionally use fontconfig to look up fonts to use for OSD. [bug #1551042] * Prefer FreeType2 rendered fonts to bitmap fonts. * Stone age platforms update * Enabled TrueSpeech codec * New X11 visual type: xine-lib may now use frontend's mutex/lock mechanism instead of XLockDisplay/XUnlockDisplay. * Allow playing of OggFlac files. [bug #1590690] * Allow playing FLAC files with an ID3 tag at the start. * Fix some crashes caused by MP3 files (and possibly others) being misdetected as AAC. @ text @d1 1 a1 1 $NetBSD: patch-da,v 1.1 2006/08/14 12:15:38 joerg Exp $ d6 1 a6 1 --- src/libffmpeg/libavcodec/h263.c.orig 2006-08-02 08:02:39.000000000 +0100 d8 1 a8 1 @@@@ -3432,6 +3432,53 @@@@ static inline int get_amv(MpegEncContext d62 1 a62 1 @@@@ -3737,124 +3784,380 @@@@ int ff_mpeg4_decode_partitions(MpegEncCo d317 1 a317 1 + const int abs_level= ABS(level); d539 1 a539 1 @@@@ -4726,309 +5029,6 @@@@ not_coded: d746 1 a746 1 - const int abs_level= ABS(level); @ 1.1 log @Disable mutex debugging by default, it results in Xine spinning around all the time at least on DragonFly. Move some inline functions around so that they exist before they are used, avoiding compilation errors on DragonFly where -fno-unit-at-a-time is disable by default. @ text @d1 1 a1 1 $NetBSD$ d6 1 a6 1 --- src/libffmpeg/libavcodec/h263.c.orig 2006-08-14 11:26:49.000000000 +0000 d8 1 a8 1 @@@@ -3395,6 +3395,53 @@@@ static inline int get_amv(MpegEncContext d62 1 a62 1 @@@@ -3700,125 +3747,380 @@@@ int ff_mpeg4_decode_partitions(MpegEncCo d76 3 d86 1 a86 2 - mb_type= s->current_picture.mb_type[xy]; - cbp = s->cbp_table[xy]; d93 1 a93 1 + if(s->qscale < s->intra_dc_threshold){ d109 1 d155 8 a162 1 - }else{ d165 2 a166 1 - } d171 1 a171 2 + scan_table = s->intra_scantable.permutated; a176 22 + if(s->mpeg_quant){ + qmul=1; + qadd=0; + if(rvlc){ + rl_vlc = rvlc_rl_inter.rl_vlc[0]; + }else{ + rl_vlc = rl_inter.rl_vlc[0]; } - } - } else { /* I-Frame */ - s->mb_intra = 1; - s->ac_pred = IS_ACPRED(s->current_picture.mb_type[xy]); - } - - if (!IS_SKIP(mb_type)) { - int i; - s->dsp.clear_blocks(s->block[0]); - /* decode each block */ - for (i = 0; i < 6; i++) { - if(mpeg4_decode_block(s, block[i], i, cbp&32, s->mb_intra, s->rvlc) < 0){ - av_log(s->avctx, AV_LOG_ERROR, "texture corrupted at %d %d %d\n", s->mb_x, s->mb_y, s->mb_intra); - return -1; a184 1 - cbp+=cbp; d186 3 d203 12 a214 1 - /* per-MB end of slice check */ d220 6 d241 1 a241 4 + if(SHOW_UBITS(re, &s->gb, 1)==0){ + av_log(s->avctx, AV_LOG_ERROR, "2. marker bit missing in rvlc esc\n"); + return -1; + }; SKIP_CACHE(re, &s->gb, 1); d248 4 a251 1 + level= SHOW_UBITS(re, &s->gb, 11); SKIP_CACHE(re, &s->gb, 11); d257 3 a259 4 + if(SHOW_UBITS(re, &s->gb, 5)!=0x10){ + av_log(s->avctx, AV_LOG_ERROR, "reverse esc missing\n"); + return -1; + }; SKIP_CACHE(re, &s->gb, 5); a265 5 + level= level * qmul + qadd; + level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1); LAST_SKIP_CACHE(re, &s->gb, 1); + SKIP_COUNTER(re, &s->gb, 1+11+5+1); - assert(s->pict_type == P_TYPE); d272 4 a283 8 + if(IS_3IV1) + cache ^= 0xC0000000; - s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; - goto end; - } - cbpc = get_vlc2(&s->gb, inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2); - }while(cbpc == 20); d293 4 a296 1 - if(cbpc & 4){ d402 1 a402 1 + if(s->qscale >= s->intra_dc_threshold){ d405 1 a405 1 + if(i == -1) i=0; d429 2 d536 4 a539 7 + }while(cbpc == 20); + + if(cbpc & 4){ s->current_picture.mb_type[xy]= MB_TYPE_INTRA; }else{ get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1); @@@@ -4678,308 +4980,6 @@@@ not_coded: d607 1 a607 1 - if(s->qscale < s->intra_dc_threshold){ d623 1 d831 1 a831 1 - if(s->qscale >= s->intra_dc_threshold){ d834 1 a834 1 - if(i == -1) i=0; @ 1.1.2.1 log @Pullup ticket 1948 - requested by abs security update for xine-lib Revisions pulled up: - pkgsrc/multimedia/xine-lib/Makefile 1.42 - pkgsrc/multimedia/xine-lib/Makefile.common 1.36 - pkgsrc/multimedia/xine-lib/distinfo 1.38 - pkgsrc/multimedia/xine-lib/patches/patch-aa 1.5 - pkgsrc/multimedia/xine-lib/patches/patch-ab 1.4 - pkgsrc/multimedia/xine-lib/patches/patch-ac 1.3 - pkgsrc/multimedia/xine-lib/patches/patch-ae 1.3 - pkgsrc/multimedia/xine-lib/patches/patch-ag 1.14 - pkgsrc/multimedia/xine-lib/patches/patch-ah 1.3 - pkgsrc/multimedia/xine-lib/patches/patch-ai 1.3 - pkgsrc/multimedia/xine-lib/patches/patch-ao 1.11 - pkgsrc/multimedia/xine-lib/patches/patch-ap 1.3 - pkgsrc/multimedia/xine-lib/patches/patch-av 1.3 - pkgsrc/multimedia/xine-lib/patches/patch-az 1.2 - pkgsrc/multimedia/xine-lib/patches/patch-bb removed - pkgsrc/multimedia/xine-lib/patches/patch-bd 1.2 - pkgsrc/multimedia/xine-lib/patches/patch-be 1.7 - pkgsrc/multimedia/xine-lib/patches/patch-bg 1.3 - pkgsrc/multimedia/xine-lib/patches/patch-bh removed - pkgsrc/multimedia/xine-lib/patches/patch-da 1.2 - pkgsrc/multimedia/xine-lib/patches/patch-db 1.2 - pkgsrc/multimedia/xine-lib/patches/patch-dc 1.2 Module Name: pkgsrc Committed By: abs Date: Fri Dec 8 09:24:26 UTC 2006 Modified Files: pkgsrc/multimedia/xine-lib: Makefile Makefile.common distinfo pkgsrc/multimedia/xine-lib/patches: patch-aa patch-ab patch-ac patch-ae patch-ag patch-ah patch-ai patch-ao patch-ap patch-av patch-az patch-bd patch-be patch-bg patch-da patch-db patch-dc Removed Files: pkgsrc/multimedia/xine-lib/patches: patch-bb patch-bh Log Message: Update xine-lib to 1.1.3 * Security fixes: - Heap overflow in libmms (related to CVE-2006-2200) - Buffer overrun in Real Media input plugin. [bug #1603458] Thanks to Roland Kay for reporting and JW for the patch. * Update build system to support x86 Darwin setups, and merge patches to support Darwin OS better. * Replace custom ALSA check with pkg-config check, and make sure 0.9.0 is the requried version. * When the compiler supports it, enable hidden visibility for all the plugins to export only the plugin info entry (and eventual needed special functions), to replace the min-symtab option that wasn't working. * Add "m4b" to the list of supported file extensions for the Qt demuxer, to allow playing (unprotected) audiobooks in AAC format. * Remove --disable-fpic hack, prefer using --without-pic instead. * Add new output plugin: PulseAudio (based on PolypAudio plugin), that uses 0.9 API (PulseAudio is PolypAudio renamed). * Remove PolypAudio plugin, latest version supported 0.7 API that is no more supported by upstream, and it's replaced by PulseAudio. * Allow 0 for DVD title/chapter (navigation or full title). * New experimental JACK audio driver. * Fix switch from alsa/dmix 2.0 to 5.1 [bug #1226595] * Don't use proxy for localhost connection. [bug #1553633] * Use mmap() to open local files if available. * Use pkg-config to look for external FFmpeg. * Allow FFmpeg to play MP3s in case MAD is not present. * Reduce the dead time when trying to connect to dead hosts, by falling back to non-blocking sockets on the last address found for an host, and allowing users to provide a connection timeout. [bug #1550844] * Return the correct error message to frontends when a file is inaccessible or the network connection is broken. [bug #1550763] * Support libcaca 0.99, thanks to cjacker huang. * Fix crash on video-only WMV streams. [bug #1564598] * Report audio stream on Shorten files (required for Amarok to play them). * Optionally use fontconfig to look up fonts to use for OSD. [bug #1551042] * Prefer FreeType2 rendered fonts to bitmap fonts. * Stone age platforms update * Enabled TrueSpeech codec * New X11 visual type: xine-lib may now use frontend's mutex/lock mechanism instead of XLockDisplay/XUnlockDisplay. * Allow playing of OggFlac files. [bug #1590690] * Allow playing FLAC files with an ID3 tag at the start. * Fix some crashes caused by MP3 files (and possibly others) being misdetected as AAC. @ text @d1 1 a1 1 $NetBSD: patch-da,v 1.2 2006/12/08 09:24:26 abs Exp $ d6 1 a6 1 --- src/libffmpeg/libavcodec/h263.c.orig 2006-08-02 08:02:39.000000000 +0100 d8 1 a8 1 @@@@ -3432,6 +3432,53 @@@@ static inline int get_amv(MpegEncContext d62 1 a62 1 @@@@ -3737,124 +3784,380 @@@@ int ff_mpeg4_decode_partitions(MpegEncCo a75 3 - - mb_type= s->current_picture.mb_type[xy]; - cbp = s->cbp_table[xy]; d83 2 a84 1 - s->use_intra_dc_vlc= s->qscale < s->intra_dc_threshold; d91 1 a91 1 + if(s->use_intra_dc_vlc){ a106 1 + ff_mpeg4_pred_dc(s, n, 0, &dc_pred_dir, 0); d152 1 a152 8 + scan_table = s->intra_scantable.permutated; + + if(s->mpeg_quant){ + qmul=1; + qadd=0; + if(rvlc){ + rl_vlc = rvlc_rl_inter.rl_vlc[0]; }else{ d155 1 a155 2 + rl_vlc = rl_inter.rl_vlc[0]; } d160 2 a161 1 - d167 22 d197 1 a198 3 - } else { /* I-Frame */ - s->mb_intra = 1; - s->ac_pred = IS_ACPRED(s->current_picture.mb_type[xy]); d213 1 a213 12 - if (!IS_SKIP(mb_type)) { - int i; - s->dsp.clear_blocks(s->block[0]); - /* decode each block */ - for (i = 0; i < 6; i++) { - if(mpeg4_decode_block(s, block[i], i, cbp&32, s->mb_intra, s->rvlc) < 0){ - av_log(s->avctx, AV_LOG_ERROR, "texture corrupted at %d %d %d\n", s->mb_x, s->mb_y, s->mb_intra); - return -1; - } - cbp+=cbp; - } - } a218 6 - /* per-MB end of slice check */ + if(SHOW_UBITS(re, &s->gb, 1)==0){ + av_log(s->avctx, AV_LOG_ERROR, "2. marker bit missing in rvlc esc\n"); + return -1; + }; SKIP_CACHE(re, &s->gb, 1); d234 4 a237 1 + level= SHOW_UBITS(re, &s->gb, 11); SKIP_CACHE(re, &s->gb, 11); d244 1 a244 4 + if(SHOW_UBITS(re, &s->gb, 5)!=0x10){ + av_log(s->avctx, AV_LOG_ERROR, "reverse esc missing\n"); + return -1; + }; SKIP_CACHE(re, &s->gb, 5); d250 4 a253 3 + level= level * qmul + qadd; + level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1); LAST_SKIP_CACHE(re, &s->gb, 1); + SKIP_COUNTER(re, &s->gb, 1+11+5+1); d260 5 a270 4 - assert(s->pict_type == P_TYPE); + if(IS_3IV1) + cache ^= 0xC0000000; d279 8 d296 1 a296 4 - s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; - goto end; - } - cbpc = get_vlc2(&s->gb, inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2); d402 1 a402 1 + if(!s->use_intra_dc_vlc){ d405 1 a405 1 + i -= i>>31; //if(i == -1) i=0; a428 2 + s->use_intra_dc_vlc= s->qscale < s->intra_dc_threshold; + d534 7 a540 4 }while(cbpc == 20); if(cbpc & 4){ @@@@ -4726,309 +5029,6 @@@@ not_coded: d608 1 a608 1 - if(s->use_intra_dc_vlc){ a623 1 - ff_mpeg4_pred_dc(s, n, 0, &dc_pred_dir, 0); d831 1 a831 1 - if(!s->use_intra_dc_vlc){ d834 1 a834 1 - i -= i>>31; //if(i == -1) i=0; @