aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-08-17 20:10:27 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-08-17 20:10:27 +0000
commitf5866a0340401ca4ef6228b3c39ed1ed8660c1b1 (patch)
treece4346c6166a77f0b163b8a349fa8e5041cf9d12 /libavcodec
parent890f093a76e06ab81742d7c8841b108db95b0046 (diff)
downloadffmpeg-f5866a0340401ca4ef6228b3c39ed1ed8660c1b1.tar.gz
skip blocks with small chroma dc too (if the user wants it) needed to avoid IDCT(input coeffs !=0) == 0 problems which cause catastrophic error accumulation at qp=1
Originally committed as revision 853 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpegvideo.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 320e2e4a82..9e8b50b1f8 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1589,7 +1589,11 @@ static inline void dct_single_coeff_elimination(MpegEncContext *s, int n, int th
const int last_index= s->block_last_index[n];
if(skip_dc) skip_dc=1;
-
+ if(threshold<0){
+ skip_dc=0;
+ threshold= -threshold;
+ }
+
/* are all which we could set to zero are allready zero? */
if(last_index<=skip_dc - 1) return;