mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-03 14:32:16 +02:00
warn the user if we had to clip some dct coefficient due to a crappy format which doenst support the whole needed range (msmpeg4/wmv mostly but mpeg1 too to a lesser extend)
Originally committed as revision 2661 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
baaf3f467b
commit
5ac59c559b
@ -3140,6 +3140,7 @@ static inline void clip_coeffs(MpegEncContext *s, DCTELEM *block, int last_index
|
|||||||
int i;
|
int i;
|
||||||
const int maxlevel= s->max_qcoeff;
|
const int maxlevel= s->max_qcoeff;
|
||||||
const int minlevel= s->min_qcoeff;
|
const int minlevel= s->min_qcoeff;
|
||||||
|
int overflow=0;
|
||||||
|
|
||||||
if(s->mb_intra){
|
if(s->mb_intra){
|
||||||
i=1; //skip clipping of intra dc
|
i=1; //skip clipping of intra dc
|
||||||
@ -3150,11 +3151,19 @@ static inline void clip_coeffs(MpegEncContext *s, DCTELEM *block, int last_index
|
|||||||
const int j= s->intra_scantable.permutated[i];
|
const int j= s->intra_scantable.permutated[i];
|
||||||
int level = block[j];
|
int level = block[j];
|
||||||
|
|
||||||
if (level>maxlevel) level=maxlevel;
|
if (level>maxlevel){
|
||||||
else if(level<minlevel) level=minlevel;
|
level=maxlevel;
|
||||||
|
overflow++;
|
||||||
|
}else if(level<minlevel){
|
||||||
|
level=minlevel;
|
||||||
|
overflow++;
|
||||||
|
}
|
||||||
|
|
||||||
block[j]= level;
|
block[j]= level;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(overflow && s->avctx->mb_decision == FF_MB_DECISION_SIMPLE)
|
||||||
|
av_log(s->avctx, AV_LOG_INFO, "warning, cliping %d dct coefficents to %d..%d\n", overflow, minlevel, maxlevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user