aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.c
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
commit64c81b2cd0dcf1fe66c381a5d2c707dddcf35a7e (patch)
tree29866e0c4f9aaae7d54ffd27a09da81faa53f5fb /libavcodec/h264.c
parent7d8154edd594981e7891d57de91f2260f8a62939 (diff)
downloadffmpeg-64c81b2cd0dcf1fe66c381a5d2c707dddcf35a7e.tar.gz
h264: move *_samples_available into the per-slice context
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index a5f64b2767..8de0673122 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -135,7 +135,7 @@ int ff_h264_check_intra4x4_pred_mode(H264Context *h, H264SliceContext *sl)
};
int i;
- if (!(h->top_samples_available & 0x8000)) {
+ if (!(sl->top_samples_available & 0x8000)) {
for (i = 0; i < 4; i++) {
int status = top[sl->intra4x4_pred_mode_cache[scan8[0] + i]];
if (status < 0) {
@@ -149,10 +149,10 @@ int ff_h264_check_intra4x4_pred_mode(H264Context *h, H264SliceContext *sl)
}
}
- if ((h->left_samples_available & 0x8888) != 0x8888) {
+ if ((sl->left_samples_available & 0x8888) != 0x8888) {
static const int mask[4] = { 0x8000, 0x2000, 0x80, 0x20 };
for (i = 0; i < 4; i++)
- if (!(h->left_samples_available & mask[i])) {
+ if (!(sl->left_samples_available & mask[i])) {
int status = left[sl->intra4x4_pred_mode_cache[scan8[0] + 8 * i]];
if (status < 0) {
av_log(h->avctx, AV_LOG_ERROR,
@@ -172,7 +172,8 @@ int ff_h264_check_intra4x4_pred_mode(H264Context *h, H264SliceContext *sl)
* 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_intra_pred_mode(H264Context *h, int mode, int is_chroma)
+int ff_h264_check_intra_pred_mode(H264Context *h, H264SliceContext *sl,
+ int mode, int is_chroma)
{
static const int8_t top[4] = { LEFT_DC_PRED8x8, 1, -1, -1 };
static const int8_t left[5] = { TOP_DC_PRED8x8, -1, 2, -1, DC_128_PRED8x8 };
@@ -184,7 +185,7 @@ int ff_h264_check_intra_pred_mode(H264Context *h, int mode, int is_chroma)
return AVERROR_INVALIDDATA;
}
- if (!(h->top_samples_available & 0x8000)) {
+ if (!(sl->top_samples_available & 0x8000)) {
mode = top[mode];
if (mode < 0) {
av_log(h->avctx, AV_LOG_ERROR,
@@ -194,12 +195,12 @@ int ff_h264_check_intra_pred_mode(H264Context *h, int mode, int is_chroma)
}
}
- if ((h->left_samples_available & 0x8080) != 0x8080) {
+ if ((sl->left_samples_available & 0x8080) != 0x8080) {
mode = left[mode];
- if (is_chroma && (h->left_samples_available & 0x8080)) {
+ if (is_chroma && (sl->left_samples_available & 0x8080)) {
// mad cow disease mode, aka MBAFF + constrained_intra_pred
mode = ALZHEIMER_DC_L0T_PRED8x8 +
- (!(h->left_samples_available & 0x8000)) +
+ (!(sl->left_samples_available & 0x8000)) +
2 * (mode == DC_128_PRED8x8);
}
if (mode < 0) {