diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-21 00:54:42 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-21 00:54:42 +0200 |
commit | e5bae39f46e55843c025d280ed5441e358e59f2e (patch) | |
tree | e2de68b736efbb95d8e83a99fdfccf7a948b62f4 /libavcodec/libx264.c | |
parent | b1fad7ac200d0779a44fc267085d7d46ce2391b9 (diff) | |
parent | 5d3addb937946eca5391e40b5e6308e74ac6f77b (diff) | |
download | ffmpeg-e5bae39f46e55843c025d280ed5441e358e59f2e.tar.gz |
Merge commit '5d3addb937946eca5391e40b5e6308e74ac6f77b'
* commit '5d3addb937946eca5391e40b5e6308e74ac6f77b':
Add a quality factor packet side data
Conflicts:
doc/APIchanges
ffmpeg.c
libavcodec/avcodec.h
libavcodec/mpegvideo_enc.c
libavcodec/version.h
Merged-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/libx264.c')
-rw-r--r-- | libavcodec/libx264.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index 868b99e732..60938cf3c2 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -302,8 +302,15 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame, } pkt->flags |= AV_PKT_FLAG_KEY*pic_out.b_keyframe; - if (ret) + if (ret) { + uint8_t *sd = av_packet_new_side_data(pkt, AV_PKT_DATA_QUALITY_FACTOR, + sizeof(int)); + if (!sd) + return AVERROR(ENOMEM); + *(int *)sd = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA; + ctx->coded_frame->quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA; + } *got_packet = ret; return 0; |