X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fituh263enc.c;h=5f15b2f77e2ab3885a3f9979a52b9e43187af7af;hb=e44b58924fe7b180bf8b0c277c15d1a58210a0e9;hp=54629a28072dbf7f76e2f1bb8f98a6329061f181;hpb=6fee1b90ce3bf4fbdfde7016e0890057c9000487;p=ffmpeg diff --git a/libavcodec/ituh263enc.c b/libavcodec/ituh263enc.c index 54629a28072..5f15b2f77e2 100644 --- a/libavcodec/ituh263enc.c +++ b/libavcodec/ituh263enc.c @@ -27,7 +27,6 @@ * h263 bitstream encoder. */ -//#define DEBUG #include #include "libavutil/attributes.h" @@ -35,14 +34,12 @@ #include "mpegvideo.h" #include "h263.h" #include "mathops.h" +#include "mpegutils.h" #include "unary.h" #include "flv.h" #include "mpeg4video.h" #include "internal.h" -//#undef NDEBUG -//#include - /** * Table of number of bits a motion vector component needs. */ @@ -569,10 +566,6 @@ void ff_h263_encode_mb(MpegEncContext * s, else level = (level - (scale>>1))/scale; - /* AIC can change CBP */ - if (level == 0 && s->block_last_index[i] == 0) - s->block_last_index[i] = -1; - if(!s->modified_quant){ if (level < -127) level = -127; @@ -595,7 +588,9 @@ void ff_h263_encode_mb(MpegEncContext * s, /* Update AC/DC tables */ *dc_ptr[i] = rec_intradc[i]; - if (s->block_last_index[i] >= 0) + /* AIC can change CBP */ + if (s->block_last_index[i] > 0 || + (s->block_last_index[i] == 0 && level !=0)) cbp |= 1 << (5 - i); } }else{