On 29/01/2019 10:14, Guo, Yejun wrote: > Signed-off-by: Guo, Yejun <yejun....@intel.com> > --- > libavcodec/libx264.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c > index a3493f3..8c96728 100644 > --- a/libavcodec/libx264.c > +++ b/libavcodec/libx264.c > @@ -383,7 +383,9 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, > const AVFrame *frame, > qoffset = roi->qoffset.num * 1.0f / roi->qoffset.den; > qoffset = av_clipf(qoffset, -1.0f, 1.0f); > > - // 25 is a number that I think it is a possible > proper scale value. > + /* qp range of x264 is from 0 to 51, just choose 25 > as the scale value, > + * so the range of final qoffset is [-25.0, 25.0]. > + */ > qoffset = qoffset * 25; > > for (int y = starty; y < endy; y++) { >
I'm not understanding where this number has come from at all. Is 25 purely arbitrary? Why does the effect vary by bit depth? From the docs explaining the best/worst behaviour on the range, I would expect this to map 0 to 0 and 1 to 3 + 6 * bit_depth (positive or negative). - Mark _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel