]> granicus.if.org Git - libvpx/commit
Removing alg_priv from vpx_codec_priv struct.
authorDmitry Kovalev <dkovalev@google.com>
Thu, 21 Aug 2014 00:02:10 +0000 (17:02 -0700)
committerDmitry Kovalev <dkovalev@google.com>
Thu, 28 Aug 2014 20:51:37 +0000 (13:51 -0700)
commit73edeb03ea1730d3a602a888fc9beb2141d951d4
treeaba54022795b04f5773c3cbc6c50b88fed11012d
parente9d106bd4571010c2224b2fcfdb69e50aa888494
Removing alg_priv from vpx_codec_priv struct.

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
vp8/vp8_cx_iface.c
vp8/vp8_dx_iface.c
vp9/vp9_cx_iface.c
vp9/vp9_dx_iface.c
vpx/internal/vpx_codec_internal.h
vpx/src/vpx_codec.c
vpx/src/vpx_decoder.c
vpx/src/vpx_encoder.c