summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 76bed662a3..ab206a2b6f 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -4177,14 +4177,14 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in
if(prefix == LEVEL_TAB_BITS){
prefix += get_level_prefix(gb);
}
- if(prefix<15){
- level_code = (prefix<<suffix_length) + get_bits(gb, suffix_length);
- }else{
- level_code = (15<<suffix_length) + get_bits(gb, prefix-3);
- if(prefix>=16)
- level_code += (1<<(prefix-3))-4096;
- }
- mask= -(level_code&1);
+ if(prefix<15){
+ level_code = (prefix<<suffix_length) + get_bits(gb, suffix_length);
+ }else{
+ level_code = (15<<suffix_length) + get_bits(gb, prefix-3);
+ if(prefix>=16)
+ level_code += (1<<(prefix-3))-4096;
+ }
+ mask= -(level_code&1);
level_code= (((2+level_code)>>1) ^ mask) - mask;
}
level[i]= level_code;