diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-07-04 21:06:43 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-07-04 21:06:43 +0400 |
commit | 784036e4044c971ecef0c14058f2770ca7d8bcd5 (patch) | |
tree | ed6a346eef93b498ce0f66b2f622ab0a8ce673d7 /libavcodec/cavs.c | |
parent | 5ca0106879079d7f82bb9335638674292794f74c (diff) |
simplify intra prediction mode decoding
Originally committed as revision 5612 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/cavs.c')
-rw-r--r-- | libavcodec/cavs.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/libavcodec/cavs.c b/libavcodec/cavs.c index a4f69630bf..996567cbe4 100644 --- a/libavcodec/cavs.c +++ b/libavcodec/cavs.c @@ -885,17 +885,14 @@ static int decode_mb_i(AVSContext *h) { nA = h->pred_mode_Y[pos-1]; nB = h->pred_mode_Y[pos-3]; - if((nA == NOT_AVAIL) || (nB == NOT_AVAIL)) - predpred = 2; - else - predpred = FFMIN(nA,nB); - if(get_bits1(gb)) - h->pred_mode_Y[pos] = predpred; - else { - h->pred_mode_Y[pos] = get_bits(gb,2); - if(h->pred_mode_Y[pos] >= predpred) - h->pred_mode_Y[pos]++; + predpred = FFMIN(nA,nB); + if(predpred == NOT_AVAIL) // if either is not available + predpred = INTRA_L_LP; + if(!get_bits1(gb)){ + int rem_mode= get_bits(gb, 2); + predpred = rem_mode + (rem_mode >= predpred); } + h->pred_mode_Y[pos] = predpred; } pred_mode_uv = get_ue_golomb(gb); if(pred_mode_uv > 6) { |