summaryrefslogtreecommitdiff
path: root/libavcodec/h264_cabac.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-02-19 02:37:11 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-02-19 02:37:11 +0000
commite69bfde6b2ee40ea202534826baab799d36f0588 (patch)
tree7af54b1627abf758c720b3faef54c78afb696e2d /libavcodec/h264_cabac.c
parenta305449df6d95bd22acc95902b4962959de490e1 (diff)
Get rid of a local variable, 10 cpu cycles faster.
Originally committed as revision 21888 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264_cabac.c')
-rw-r--r--libavcodec/h264_cabac.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c
index b78847eed8..641827db5f 100644
--- a/libavcodec/h264_cabac.c
+++ b/libavcodec/h264_cabac.c
@@ -914,17 +914,16 @@ static int decode_cabac_mb_mvd( H264Context *h, int list, int n, int l ) {
h->mvd_cache[list][scan8[n] - 8][l];
int ctxbase = (l == 0) ? 40 : 47;
int mvd;
- int ctx = (amvd>2) + (amvd>32);
- if(!get_cabac(&h->cabac, &h->cabac_state[ctxbase+ctx]))
+ if(!get_cabac(&h->cabac, &h->cabac_state[ctxbase+(amvd>2) + (amvd>32)]))
return 0;
mvd= 1;
- ctx= 3;
- while( mvd < 9 && get_cabac( &h->cabac, &h->cabac_state[ctxbase+ctx] ) ) {
+ ctxbase+= 3;
+ while( mvd < 9 && get_cabac( &h->cabac, &h->cabac_state[ctxbase] ) ) {
+ if( mvd < 4 )
+ ctxbase++;
mvd++;
- if( ctx < 6 )
- ctx++;
}
if( mvd >= 9 ) {