aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-01-07 15:31:54 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-01-07 15:31:54 +0000
commitd6856c57084d7ae4f417072cc2b988269dcc8de7 (patch)
tree294b82b07056a9d8c35de163521be79d162e7a0f /libavcodec
parent0dc5dc08db8aa8f0c05376bc93be979bf76a0bb5 (diff)
downloadffmpeg-d6856c57084d7ae4f417072cc2b988269dcc8de7.tar.gz
Move restore_ac_coeffs() call into decode_ac_pred().
This makes decode_ac_pred() easier to understand. Originally committed as revision 21062 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h263.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/h263.c b/libavcodec/h263.c
index 5b0ea567ef..a3426ceb4d 100644
--- a/libavcodec/h263.c
+++ b/libavcodec/h263.c
@@ -462,7 +462,12 @@ static inline int decide_ac_pred(MpegEncContext * s, DCTELEM block[6][64], int d
score += get_block_rate(s, block[n], s->block_last_index[n], st[n]);
}
- return score < 0;
+ if(score < 0){
+ return 1;
+ }else{
+ restore_ac_coeffs(s, block, dir, st, zigzag_last_index);
+ return 0;
+ }
}
/**
@@ -1453,8 +1458,6 @@ void mpeg4_encode_mb(MpegEncContext * s,
if(s->flags & CODEC_FLAG_AC_PRED){
s->ac_pred= decide_ac_pred(s, block, dir, scan_table, zigzag_last_index);
- if(!s->ac_pred)
- restore_ac_coeffs(s, block, dir, scan_table, zigzag_last_index);
}else{
for(i=0; i<6; i++)
scan_table[i]= s->intra_scantable.permutated;