summaryrefslogtreecommitdiff
path: root/libavcodec/h264.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2015-01-17 22:28:46 +0100
committerAnton Khirnov <anton@khirnov.net>2015-03-21 11:27:12 +0100
commitf69574cf7aca4fe4d57a2155e925f37fc863474d (patch)
treed7a953cd7847cc7db8c44e2fe31fa5dca011d321 /libavcodec/h264.h
parent64c81b2cd0dcf1fe66c381a5d2c707dddcf35a7e (diff)
h264: move non_zero_count_cache into the per-slice context
Diffstat (limited to 'libavcodec/h264.h')
-rw-r--r--libavcodec/h264.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index 308ca93197..521ceebe70 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -341,6 +341,12 @@ typedef struct H264SliceContext {
unsigned int top_samples_available;
unsigned int topright_samples_available;
unsigned int left_samples_available;
+
+ /**
+ * non zero coeff count cache.
+ * is 64 if not available.
+ */
+ DECLARE_ALIGNED(8, uint8_t, non_zero_count_cache)[15 * 8];
} H264SliceContext;
/**
@@ -381,12 +387,6 @@ typedef struct H264Context {
H264PredContext hpc;
uint8_t (*top_borders[2])[(16 * 3) * 2];
- /**
- * non zero coeff count cache.
- * is 64 if not available.
- */
- DECLARE_ALIGNED(8, uint8_t, non_zero_count_cache)[15 * 8];
-
uint8_t (*non_zero_count)[48];
/**
@@ -944,11 +944,12 @@ static av_always_inline void write_back_intra_pred_mode(H264Context *h,
i4x4[6] = i4x4_cache[7 + 8 * 1];
}
-static av_always_inline void write_back_non_zero_count(H264Context *h)
+static av_always_inline void write_back_non_zero_count(H264Context *h,
+ H264SliceContext *sl)
{
const int mb_xy = h->mb_xy;
uint8_t *nnz = h->non_zero_count[mb_xy];
- uint8_t *nnz_cache = h->non_zero_count_cache;
+ uint8_t *nnz_cache = sl->non_zero_count_cache;
AV_COPY32(&nnz[ 0], &nnz_cache[4 + 8 * 1]);
AV_COPY32(&nnz[ 4], &nnz_cache[4 + 8 * 2]);