[FFmpeg-cvslog] avcodec/libx264: Export choosen pict_type
Michael Niedermayer
git at videolan.org
Wed Jul 22 20:58:10 CEST 2015
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Jul 22 20:49:01 2015 +0200| [975257ffe6501c2017d2d6e7d912abfa168881b3] | committer: Michael Niedermayer
avcodec/libx264: Export choosen pict_type
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=975257ffe6501c2017d2d6e7d912abfa168881b3
---
libavcodec/libx264.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 3a55b5d..44c6a70 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -253,6 +253,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
x264_nal_t *nal;
int nnal, i, ret;
x264_picture_t pic_out = {0};
+ int pict_type;
x264_picture_init( &x4->pic );
x4->pic.img.i_csp = x4->params.i_csp;
@@ -287,27 +288,31 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
pkt->pts = pic_out.i_pts;
pkt->dts = pic_out.i_dts;
-#if FF_API_CODED_FRAME
-FF_DISABLE_DEPRECATION_WARNINGS
+
switch (pic_out.i_type) {
case X264_TYPE_IDR:
case X264_TYPE_I:
- ctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+ pict_type = AV_PICTURE_TYPE_I;
break;
case X264_TYPE_P:
- ctx->coded_frame->pict_type = AV_PICTURE_TYPE_P;
+ pict_type = AV_PICTURE_TYPE_P;
break;
case X264_TYPE_B:
case X264_TYPE_BREF:
- ctx->coded_frame->pict_type = AV_PICTURE_TYPE_B;
+ pict_type = AV_PICTURE_TYPE_B;
break;
+ default:
+ pict_type = AV_PICTURE_TYPE_NONE;
}
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ ctx->coded_frame->pict_type = pict_type;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
pkt->flags |= AV_PKT_FLAG_KEY*pic_out.b_keyframe;
if (ret) {
- ff_side_data_set_encoder_stats(pkt, (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA, NULL, 0, 0);
+ ff_side_data_set_encoder_stats(pkt, (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA, NULL, 0, pict_type);
#if FF_API_CODED_FRAME
FF_DISABLE_DEPRECATION_WARNINGS
More information about the ffmpeg-cvslog
mailing list