diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-03-14 02:13:39 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-03-15 03:02:27 +0100 |
commit | ff9adf57250f5615ff2da0e4c6dcd5418f99c439 (patch) | |
tree | c9bc0c3a10074d458324b0e7191e29f4fbe5b0d8 | |
parent | a0813e7f00ff0ed5d10a3d3fa33a3a2dadba5459 (diff) | |
download | ffmpeg-ff9adf57250f5615ff2da0e4c6dcd5418f99c439.tar.gz |
mjpegdec: export qp table
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/mjpegdec.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index e6dfe23a69..78ba8e840a 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -1743,12 +1743,19 @@ eoi_parser: *got_frame = 1; s->got_picture = 0; - if (!s->lossless && - avctx->debug & FF_DEBUG_QP) { - av_log(avctx, AV_LOG_DEBUG, - "QP: %d\n", FFMAX3(s->qscale[0], - s->qscale[1], - s->qscale[2])); + if (!s->lossless) { + int qp = FFMAX3(s->qscale[0], + s->qscale[1], + s->qscale[2]); + int qpw = (s->width + 15) / 16; + AVBufferRef *qp_table_buf = av_buffer_alloc(qpw); + if (qp_table_buf) { + memset(qp_table_buf->data, qp, qpw); + av_frame_set_qp_table(data, qp_table_buf, 0, FF_QSCALE_TYPE_MPEG1); + } + + if(avctx->debug & FF_DEBUG_QP) + av_log(avctx, AV_LOG_DEBUG, "QP: %d\n", qp); } goto the_end; |