Unified · Split
| @@ -1247,9 +1247,11 @@ static inline void cx_pktcpy(struct FrameListData *dst, · 1246 unmodified lines | |||
| 1247 | static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame, | 1247 | static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame, |
| 1248 | AVPacket *pkt) | 1248 | AVPacket *pkt) |
| 1249 | { | 1249 | { |
| 1250 | VPxContext *ctx = avctx->priv_data; | ||
| 1250 | int ret = ff_get_encode_buffer(avctx, pkt, cx_frame->sz, 0); | 1251 | int ret = ff_get_encode_buffer(avctx, pkt, cx_frame->sz, 0); |
| 1251 | uint8_t *side_data; | 1252 | uint8_t *side_data; |
| 1252 | int pict_type; | 1253 | int pict_type; |
| 1254 | int quality; | ||
| 1253 | 1255 | ||
| 1254 | if (ret < 0) | 1256 | if (ret < 0) |
| 1255 | return ret; | 1257 | return ret; |
| @@ -1264,7 +1266,10 @@ static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame, · 8 unmodified lines | |||
| 1264 | pict_type = AV_PICTURE_TYPE_P; | 1266 | pict_type = AV_PICTURE_TYPE_P; |
| 1265 | } | 1267 | } |
| 1266 | 1268 | ||
| 1267 | ff_side_data_set_encoder_stats(pkt, 0, cx_frame->sse + 1, | 1269 | ret = vpx_codec_control(&ctx->encoder, VP8E_GET_LAST_QUANTIZER_64, &quality); |
| 1270 | if (ret != VPX_CODEC_OK) | ||
| 1271 | quality = 0; | ||
| 1272 | ff_side_data_set_encoder_stats(pkt, quality * FF_QP2LAMBDA, cx_frame->sse + 1, | ||
| 1268 | cx_frame->have_sse ? 3 : 0, pict_type); | 1273 | cx_frame->have_sse ? 3 : 0, pict_type); |
| 1269 | 1274 | ||
| 1270 | if (cx_frame->have_sse) { | 1275 | if (cx_frame->have_sse) { |