[FFmpeg-cvslog] avcodec/libx265: export choosen picture types

Michael Niedermayer git at videolan.org
Tue Mar 31 20:46:32 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Mar 31 00:37:46 2015 +0200| [2ddedfd39c0d6b49e6396c535d5cb21846676a13] | committer: Michael Niedermayer

avcodec/libx265: export choosen picture types

Fixes part of ticket 4285

Reviewed-by Derek Buitenhuis <derek.buitenhuis at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2ddedfd39c0d6b49e6396c535d5cb21846676a13
---

 libavcodec/libx265.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index 5a26ca9..19217b0 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -272,6 +272,19 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     pkt->pts = x265pic_out.pts;
     pkt->dts = x265pic_out.dts;
 
+    switch (x265pic_out.sliceType) {
+    case X265_TYPE_IDR:
+    case X265_TYPE_I:
+        avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+        break;
+    case X265_TYPE_P:
+        avctx->coded_frame->pict_type = AV_PICTURE_TYPE_P;
+        break;
+    case X265_TYPE_B:
+        avctx->coded_frame->pict_type = AV_PICTURE_TYPE_B;
+        break;
+    }
+
     *got_packet = 1;
     return 0;
 }



More information about the ffmpeg-cvslog mailing list