summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-10-24 02:59:36 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-10-24 02:59:36 +0000
commitdb4d9faf8d5269f195e0271067fc0e3cbc0838b5 (patch)
treee71667f84afda20e8e8d2554c6208347cbb0350c /libavcodec/h264.c
parent58897665aed5ee7612b64412768f6ecb026592d8 (diff)
optimzation
Originally committed as revision 3630 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 9bd155dda5..1518a07d7c 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -4118,8 +4118,7 @@ static int decode_cabac_mb_mvd( H264Context *h, int list, int n, int l ) {
int amvd = abs( h->mvd_cache[list][scan8[n] - 1][l] ) +
abs( h->mvd_cache[list][scan8[n] - 8][l] );
int ctxbase = (l == 0) ? 40 : 47;
- int ctx;
- int mvd = 0;
+ int ctx, mvd;
if( amvd < 3 )
ctx = 0;
@@ -4128,11 +4127,14 @@ static int decode_cabac_mb_mvd( H264Context *h, int list, int n, int l ) {
else
ctx = 1;
+ if(!get_cabac(&h->cabac, &h->cabac_state[ctxbase+ctx]))
+ return 0;
+
+ mvd= 1;
+ ctx= 3;
while( mvd < 9 && get_cabac( &h->cabac, &h->cabac_state[ctxbase+ctx] ) ) {
mvd++;
- if( ctx < 3 )
- ctx = 3;
- else if( ctx < 6 )
+ if( ctx < 6 )
ctx++;
}
@@ -4147,12 +4149,10 @@ static int decode_cabac_mb_mvd( H264Context *h, int list, int n, int l ) {
mvd += 1 << k;
}
}
- if( mvd != 0 && get_cabac_bypass( &h->cabac ) )
- return -mvd;
- return mvd;
+ if( get_cabac_bypass( &h->cabac ) ) return -mvd;
+ else return mvd;
}
-
static int inline get_cabac_cbf_ctx( H264Context *h, int cat, int idx ) {
int nza, nzb;
int ctx = 0;