[FFmpeg-devel] [PATCH] avcodec/libx264: update notes to explain the scale chosen for ROI encoding
Guo, Yejun
yejun.guo at intel.com
Tue Jan 29 12:14:31 EET 2019
Signed-off-by: Guo, Yejun <yejun.guo at 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++) {
--
2.7.4
More information about the ffmpeg-devel
mailing list