Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Gramner <gramner@twoorioles.com>2019-06-27 21:32:26 +0300
committerHenrik Gramner <henrik@gramner.com>2019-07-02 19:39:04 +0300
commit0276455de73c4a520df12a3d6f80574b988d219a (patch)
tree7c0e3cc1368c0458fa8234ee58fa005baa79a12d /src/internal.h
parentbeda6e0d1c37f06e4e03f7ebe13311bd8b18245e (diff)
Consolidate scratch buffers
Also eliminate some pointer chasing by allocating tile context buffers as part of the struct instead of having the struct contain pointers to separately allocated buffers.
Diffstat (limited to 'src/internal.h')
-rw-r--r--src/internal.h52
1 files changed, 41 insertions, 11 deletions
diff --git a/src/internal.h b/src/internal.h
index cabfd8f..444e529 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -275,24 +275,54 @@ struct Dav1dTileContext {
Dav1dTileState *ts;
int bx, by;
BlockContext l, *a;
- coef *cf;
- pixel *emu_edge; // stride=192 for non-SVC, or 320 for SVC
+ ALIGN(union, 32) {
+ int16_t cf_8bpc [32 * 32];
+ int32_t cf_16bpc[32 * 32];
+ };
// FIXME types can be changed to pixel (and dynamically allocated)
// which would make copy/assign operations slightly faster?
uint16_t al_pal[2 /* a/l */][32 /* bx/y4 */][3 /* plane */][8 /* palette_idx */];
- ALIGN(uint16_t pal[3 /* plane */][8 /* palette_idx */], 16);
uint8_t pal_sz_uv[2 /* a/l */][32 /* bx4/by4 */];
uint8_t txtp_map[32 * 32]; // inter-only
- Dav1dWarpedMotionParams warpmv;
- union {
- void *mem;
- uint8_t *pal_idx;
- int16_t *ac;
- pixel *interintra, *lap;
- int16_t *compinter;
+ ALIGN(union, 32) {
+ struct {
+ union {
+ uint8_t lap_8bpc [128 * 32];
+ uint16_t lap_16bpc[128 * 32];
+ struct {
+ int16_t compinter[2][128 * 128];
+ uint8_t seg_mask[128 * 128];
+ };
+ };
+ union {
+ // stride=192 for non-SVC, or 320 for SVC
+ uint8_t emu_edge_8bpc [320 * (256 + 7)];
+ uint16_t emu_edge_16bpc[320 * (256 + 7)];
+ };
+ };
+ struct {
+ uint8_t interintra_8bpc[64 * 64];
+ uint8_t edge_8bpc[257];
+ };
+ struct {
+ uint16_t interintra_16bpc[64 * 64];
+ uint16_t edge_16bpc[257];
+ };
+ struct {
+ uint8_t pal_idx[2 * 64 * 64];
+ union {
+ struct {
+ uint8_t pal_order[64][8];
+ uint8_t pal_ctx[64];
+ };
+ uint8_t levels[36 * 36];
+ };
+ uint16_t pal[3 /* plane */][8 /* palette_idx */];
+ };
+ int16_t ac[32 * 32];
} scratch;
- ALIGN(uint8_t scratch_seg_mask[128 * 128], 32);
+ Dav1dWarpedMotionParams warpmv;
Av1Filter *lf_mask;
int8_t *cur_sb_cdef_idx_ptr;
// for chroma sub8x8, we need to know the filter for all 4 subblocks in