aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libvpxenc.c
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2015-07-28 22:59:42 -0700
committerJames Zern <jzern@google.com>2015-07-29 19:59:20 -0700
commit9723d439fdebe7c9fd3819785173fc28509c434b (patch)
tree2a70164f1f6c63fc102a4a579f652f161de3d24b /libavcodec/libvpxenc.c
parent88df16fe6dd18e98244238f93ce9ff7f6c2fc216 (diff)
downloadffmpeg-9723d439fdebe7c9fd3819785173fc28509c434b.tar.gz
libvpxenc: report pict_type/error via side-data
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Zern <jzern@google.com>
Diffstat (limited to 'libavcodec/libvpxenc.c')
-rw-r--r--libavcodec/libvpxenc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 1a1d55f8f5..3db617d9f2 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -690,6 +690,7 @@ static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame,
int ret = ff_alloc_packet2(avctx, pkt, cx_frame->sz, 0);
uint8_t *side_data;
if (ret >= 0) {
+ int pict_type;
memcpy(pkt->data, cx_frame->buf, pkt->size);
pkt->pts = pkt->dts = cx_frame->pts;
#if FF_API_CODED_FRAME
@@ -700,20 +701,25 @@ FF_ENABLE_DEPRECATION_WARNINGS
#endif
if (!!(cx_frame->flags & VPX_FRAME_IS_KEY)) {
+ pict_type = AV_PICTURE_TYPE_I;
#if FF_API_CODED_FRAME
FF_DISABLE_DEPRECATION_WARNINGS
- avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+ avctx->coded_frame->pict_type = pict_type;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
pkt->flags |= AV_PKT_FLAG_KEY;
} else {
+ pict_type = AV_PICTURE_TYPE_P;
#if FF_API_CODED_FRAME
FF_DISABLE_DEPRECATION_WARNINGS
- avctx->coded_frame->pict_type = AV_PICTURE_TYPE_P;
+ avctx->coded_frame->pict_type = pict_type;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
+ ff_side_data_set_encoder_stats(pkt, 0, cx_frame->sse + 1,
+ cx_frame->have_sse ? 3 : 0, pict_type);
+
if (cx_frame->have_sse) {
int i;
/* Beware of the Y/U/V/all order! */