simplify intra prediction mode decoding

Originally committed as revision 5612 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2006-07-04 17:06:43 +00:00
parent 5ca0106879
commit 784036e404
2 changed files with 10 additions and 20 deletions

View File

@ -885,17 +885,14 @@ static int decode_mb_i(AVSContext *h) {
nA = h->pred_mode_Y[pos-1]; nA = h->pred_mode_Y[pos-1];
nB = h->pred_mode_Y[pos-3]; nB = h->pred_mode_Y[pos-3];
if((nA == NOT_AVAIL) || (nB == NOT_AVAIL))
predpred = 2;
else
predpred = FFMIN(nA,nB); predpred = FFMIN(nA,nB);
if(get_bits1(gb)) if(predpred == NOT_AVAIL) // if either is not available
h->pred_mode_Y[pos] = predpred; predpred = INTRA_L_LP;
else { if(!get_bits1(gb)){
h->pred_mode_Y[pos] = get_bits(gb,2); int rem_mode= get_bits(gb, 2);
if(h->pred_mode_Y[pos] >= predpred) predpred = rem_mode + (rem_mode >= predpred);
h->pred_mode_Y[pos]++;
} }
h->pred_mode_Y[pos] = predpred;
} }
pred_mode_uv = get_ue_golomb(gb); pred_mode_uv = get_ue_golomb(gb);
if(pred_mode_uv > 6) { if(pred_mode_uv > 6) {

View File

@ -5258,18 +5258,11 @@ decode_intra_mb:
// fill_intra4x4_pred_table(h); // fill_intra4x4_pred_table(h);
for(i=0; i<16; i+=di){ for(i=0; i<16; i+=di){
const int mode_coded= !get_bits1(&s->gb); int mode= pred_intra_mode(h, i);
const int predicted_mode= pred_intra_mode(h, i);
int mode;
if(mode_coded){ if(!get_bits1(&s->gb)){
const int rem_mode= get_bits(&s->gb, 3); const int rem_mode= get_bits(&s->gb, 3);
if(rem_mode<predicted_mode) mode = rem_mode + (rem_mode >= mode);
mode= rem_mode;
else
mode= rem_mode + 1;
}else{
mode= predicted_mode;
} }
if(di==4) if(di==4)