-
Dmitry Kovalev authored
In order to understand memory layout consider the declaration of the following structs. The first one is a part of our API: struct vpx_codec_ctx { // ... struct vpx_codec_priv *priv; }; The second one is defined in vpx_codec_internal.h: struct vpx_codec_priv { // ... }; The following struct is defined 4 times for encoder/decoder VP8/VP9: struct vpx_codec_alg_priv { struct vpx_codec_priv base; // ... }; Private data allocation for the given ctx: struct vpx_codec_ctx *ctx = <get> struct vpx_codec_alg_priv *alg_priv = <allocate> ctx->priv = (struct vpx_codec_priv *)alg_priv; The cast works because vpx_codec_alg_priv has a vpx_codec_priv instance as a first member 'base'. Change-Id: I10d1afc8c9a7dfda50baade8c7b0296678bdb0d0
73edeb03
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
internal | ||
src | ||
exports_com | ||
exports_dec | ||
exports_enc | ||
svc_context.h | ||
vp8.h | ||
vp8cx.h | ||
vp8dx.h | ||
vpx_codec.h | ||
vpx_codec.mk | ||
vpx_decoder.h | ||
vpx_encoder.h | ||
vpx_frame_buffer.h | ||
vpx_image.h | ||
vpx_integer.h |