diff options
author | Anton Khirnov <anton@khirnov.net> | 2015-01-17 22:28:46 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-03-21 11:27:12 +0100 |
commit | 7d8154edd594981e7891d57de91f2260f8a62939 (patch) | |
tree | 0ec7ffcb096bb6ca6f1b676018cfd9bca3acf606 /libavcodec/h264.c | |
parent | 8b00f4df20f4a8ab0656fdaf7d00233a6515a052 (diff) | |
download | ffmpeg-7d8154edd594981e7891d57de91f2260f8a62939.tar.gz |
h264: move intra4x4_pred_mode[_cache] into the per-slice context
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 5eee4d9d90..a5f64b2767 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -125,7 +125,7 @@ void ff_h264_draw_horiz_band(H264Context *h, int y, int height) * Check if the top & left blocks are available if needed and * change the dc mode so it only uses the available blocks. */ -int ff_h264_check_intra4x4_pred_mode(H264Context *h) +int ff_h264_check_intra4x4_pred_mode(H264Context *h, H264SliceContext *sl) { static const int8_t top[12] = { -1, 0, LEFT_DC_PRED, -1, -1, -1, -1, -1, 0 @@ -137,14 +137,14 @@ int ff_h264_check_intra4x4_pred_mode(H264Context *h) if (!(h->top_samples_available & 0x8000)) { for (i = 0; i < 4; i++) { - int status = top[h->intra4x4_pred_mode_cache[scan8[0] + i]]; + int status = top[sl->intra4x4_pred_mode_cache[scan8[0] + i]]; if (status < 0) { av_log(h->avctx, AV_LOG_ERROR, "top block unavailable for requested intra4x4 mode %d at %d %d\n", status, h->mb_x, h->mb_y); return AVERROR_INVALIDDATA; } else if (status) { - h->intra4x4_pred_mode_cache[scan8[0] + i] = status; + sl->intra4x4_pred_mode_cache[scan8[0] + i] = status; } } } @@ -153,14 +153,14 @@ int ff_h264_check_intra4x4_pred_mode(H264Context *h) static const int mask[4] = { 0x8000, 0x2000, 0x80, 0x20 }; for (i = 0; i < 4; i++) if (!(h->left_samples_available & mask[i])) { - int status = left[h->intra4x4_pred_mode_cache[scan8[0] + 8 * i]]; + int status = left[sl->intra4x4_pred_mode_cache[scan8[0] + 8 * i]]; if (status < 0) { av_log(h->avctx, AV_LOG_ERROR, "left block unavailable for requested intra4x4 mode %d at %d %d\n", status, h->mb_x, h->mb_y); return AVERROR_INVALIDDATA; } else if (status) { - h->intra4x4_pred_mode_cache[scan8[0] + 8 * i] = status; + sl->intra4x4_pred_mode_cache[scan8[0] + 8 * i] = status; } } } @@ -409,6 +409,8 @@ int ff_h264_alloc_tables(H264Context *h) FF_ALLOCZ_OR_GOTO(h->avctx, h->intra4x4_pred_mode, row_mb_num * 8 * sizeof(uint8_t), fail) + h->slice_ctx[0].intra4x4_pred_mode = h->intra4x4_pred_mode; + FF_ALLOCZ_OR_GOTO(h->avctx, h->non_zero_count, big_mb_num * 48 * sizeof(uint8_t), fail) FF_ALLOCZ_OR_GOTO(h->avctx, h->slice_table_base, |