/*}}}*/ static void do_tile(int I, int J, struct node *cursor, struct tower_table *table, FILE *out)/*{{{*/ { struct micro sub[16][16]; /* Clear the array */ clear_sub(sub); gather(4, 0, 0, cursor, sub); render(I, J, cursor, sub, table, out); }
static void reset(struct sd *sd) { struct sd_lavc_priv *priv = sd->priv; for (int n = 0; n < MAX_QUEUE; n++) clear_sub(&priv->subs[n]); // lavc might not do this right for all codecs; may need close+reopen avcodec_flush_buffers(priv->avctx); }
static void alloc_sub(struct sd_lavc_priv *priv) { clear_sub(&priv->subs[MAX_QUEUE - 1]); for (int n = MAX_QUEUE - 1; n > 0; n--) priv->subs[n] = priv->subs[n - 1]; // clear only some fields; the memory allocs can be reused priv->subs[0].valid = false; priv->subs[0].count = 0; priv->subs[0].id = priv->new_id++; }
static void uninit(struct sd *sd) { struct sd_lavc_priv *priv = sd->priv; for (int n = 0; n < MAX_QUEUE; n++) clear_sub(&priv->subs[n]); avcodec_close(priv->avctx); av_free(priv->avctx->extradata); av_free(priv->avctx); talloc_free(priv); }