aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libxavs.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-07-21 00:54:42 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-21 00:54:42 +0200
commite5bae39f46e55843c025d280ed5441e358e59f2e (patch)
treee2de68b736efbb95d8e83a99fdfccf7a948b62f4 /libavcodec/libxavs.c
parentb1fad7ac200d0779a44fc267085d7d46ce2391b9 (diff)
parent5d3addb937946eca5391e40b5e6308e74ac6f77b (diff)
downloadffmpeg-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/libxavs.c')
-rw-r--r--libavcodec/libxavs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/libxavs.c b/libavcodec/libxavs.c
index ca9539a656..e26204ccbf 100644
--- a/libavcodec/libxavs.c
+++ b/libavcodec/libxavs.c
@@ -117,6 +117,7 @@ static int XAVS_frame(AVCodecContext *avctx, AVPacket *pkt,
xavs_nal_t *nal;
int nnal, i, ret;
xavs_picture_t pic_out;
+ uint8_t *sd;
x4->pic.img.i_csp = XAVS_CSP_I420;
x4->pic.img.i_plane = 3;
@@ -191,6 +192,11 @@ static int XAVS_frame(AVCodecContext *avctx, AVPacket *pkt,
avctx->coded_frame->quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA;
+ 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;
+
x4->out_frame_count++;
*got_packet = ret;
return 0;