To be used for frame stats output of vpxdec.
Change-Id: I0739a01bd3635c4b3fedd58f3e27363ce8fb1b1e
vpx_codec_err_t vp8dx_set_reference(struct VP8D_COMP *comp,
enum vpx_ref_frame_type ref_frame_flag,
YV12_BUFFER_CONFIG *sd);
+int vp8dx_get_quantizer(const struct VP8D_COMP *c);
#ifdef __cplusplus
}
remove_decompressor(pbi);
return VPX_CODEC_OK;
}
+
+int vp8dx_get_quantizer(const VP8D_COMP *cpi) {
+ return cpi->common.base_qindex;
+}
}
}
+static vpx_codec_err_t vp8_get_quantizer(vpx_codec_alg_priv_t *ctx,
+ va_list args) {
+ int *const arg = va_arg(args, int *);
+ if (arg == NULL) return VPX_CODEC_INVALID_PARAM;
+ *arg = vp8dx_get_quantizer(ctx->yv12_frame_buffers.pbi[0]);
+ return VPX_CODEC_OK;
+}
+
static vpx_codec_err_t vp8_set_postproc(vpx_codec_alg_priv_t *ctx,
va_list args) {
#if CONFIG_POSTPROC
{ VP8D_GET_LAST_REF_UPDATES, vp8_get_last_ref_updates },
{ VP8D_GET_FRAME_CORRUPTED, vp8_get_frame_corrupted },
{ VP8D_GET_LAST_REF_USED, vp8_get_last_ref_frame },
+ { VPXD_GET_LAST_QUANTIZER, vp8_get_quantizer },
{ VPXD_SET_DECRYPTOR, vp8_set_decryptor },
{ -1, NULL },
};
#endif
}
+static vpx_codec_err_t ctrl_get_quantizer(vpx_codec_alg_priv_t *ctx,
+ va_list args) {
+ int *const arg = va_arg(args, int *);
+ if (arg == NULL) return VPX_CODEC_INVALID_PARAM;
+ *arg =
+ ((FrameWorkerData *)ctx->frame_workers[0].data1)->pbi->common.base_qindex;
+ return VPX_CODEC_OK;
+}
+
static vpx_codec_err_t ctrl_get_last_ref_updates(vpx_codec_alg_priv_t *ctx,
va_list args) {
int *const update_info = va_arg(args, int *);
{ VP9_DECODE_SVC_SPATIAL_LAYER, ctrl_set_spatial_layer_svc },
// Getters
+ { VPXD_GET_LAST_QUANTIZER, ctrl_get_quantizer },
{ VP8D_GET_LAST_REF_UPDATES, ctrl_get_last_ref_updates },
{ VP8D_GET_FRAME_CORRUPTED, ctrl_get_frame_corrupted },
{ VP9_GET_REFERENCE, ctrl_get_reference },
*/
VP9_DECODE_SVC_SPATIAL_LAYER,
+ /*!\brief Codec control function to get last decoded frame quantizer.
+ *
+ * Return value uses internal quantizer scale defined by the codec.
+ *
+ * Supported in codecs: VP8, VP9
+ */
+ VPXD_GET_LAST_QUANTIZER,
+
VP8_DECODER_CTRL_ID_MAX
};
#define VPX_CTRL_VP8D_GET_FRAME_CORRUPTED
VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_USED, int *)
#define VPX_CTRL_VP8D_GET_LAST_REF_USED
+VPX_CTRL_USE_TYPE(VPXD_GET_LAST_QUANTIZER, int *)
+#define VPX_CTRL_VPXD_GET_LAST_QUANTIZER
VPX_CTRL_USE_TYPE(VPXD_SET_DECRYPTOR, vpx_decrypt_init *)
#define VPX_CTRL_VPXD_SET_DECRYPTOR
VPX_CTRL_USE_TYPE(VP8D_SET_DECRYPTOR, vpx_decrypt_init *)