• Dmitry Kovalev's avatar
    Removing alg_priv from vpx_codec_priv struct. · 73edeb03
    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
build Loading commit data...
examples Loading commit data...
test Loading commit data...
third_party Loading commit data...
tools Loading commit data...
vp8 Loading commit data...
vp9 Loading commit data...
vpx Loading commit data...
vpx_mem Loading commit data...
vpx_ports Loading commit data...
vpx_scale Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
AUTHORS Loading commit data...
CHANGELOG Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
args.c Loading commit data...
args.h Loading commit data...
configure Loading commit data...
docs.mk Loading commit data...
examples.mk Loading commit data...
ivfdec.c Loading commit data...
ivfdec.h Loading commit data...
ivfenc.c Loading commit data...
ivfenc.h Loading commit data...
keywords.dox Loading commit data...
libs.doxy_template Loading commit data...
libs.mk Loading commit data...
mainpage.dox Loading commit data...
md5_utils.c Loading commit data...
md5_utils.h Loading commit data...
rate_hist.c Loading commit data...
rate_hist.h Loading commit data...
solution.mk Loading commit data...
tools_common.c Loading commit data...
tools_common.h Loading commit data...
usage.dox Loading commit data...
usage_cx.dox Loading commit data...
usage_dx.dox Loading commit data...
video_common.h Loading commit data...
video_reader.c Loading commit data...
video_reader.h Loading commit data...
video_writer.c Loading commit data...
video_writer.h Loading commit data...
vpxdec.c Loading commit data...
vpxenc.c Loading commit data...
vpxenc.h Loading commit data...
vpxstats.c Loading commit data...
vpxstats.h Loading commit data...
warnings.c Loading commit data...
warnings.h Loading commit data...
webmdec.cc Loading commit data...
webmdec.h Loading commit data...
webmenc.cc Loading commit data...
webmenc.h Loading commit data...
y4menc.c Loading commit data...
y4menc.h Loading commit data...
y4minput.c Loading commit data...
y4minput.h Loading commit data...