summaryrefslogtreecommitdiff
path: root/libavcodec/h264_mb_template.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
commitd231e84b06a9964c840cff4e228509f706165fb6 (patch)
tree0bd1fa87587cf1601faf4ef9648110442e586a1d /libavcodec/h264_mb_template.c
parentd40ae0e595fe90b5583b9269f8bb000402bde5a6 (diff)
h264: move the quantizers into the per-slice context
Diffstat (limited to 'libavcodec/h264_mb_template.c')
-rw-r--r--libavcodec/h264_mb_template.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/libavcodec/h264_mb_template.c b/libavcodec/h264_mb_template.c
index 262ad0c2f6..4805f69055 100644
--- a/libavcodec/h264_mb_template.c
+++ b/libavcodec/h264_mb_template.c
@@ -50,7 +50,7 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl)
int linesize, uvlinesize /*dct_offset*/;
int i, j;
int *block_offset = &h->block_offset[0];
- const int transform_bypass = !SIMPLE && (h->qscale == 0 && h->sps.transform_bypass);
+ const int transform_bypass = !SIMPLE && (sl->qscale == 0 && h->sps.transform_bypass);
/* is_h264 should always be true if SVQ3 is disabled. */
const int is_h264 = !CONFIG_SVQ3_DECODER || SIMPLE || h->avctx->codec_id == AV_CODEC_ID_H264;
void (*idct_add)(uint8_t *dst, int16_t *block, int stride);
@@ -167,7 +167,7 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl)
h->hpc.pred8x8[h->chroma_pred_mode](dest_cr, uvlinesize);
}
- hl_decode_mb_predict_luma(h, mb_type, is_h264, SIMPLE,
+ hl_decode_mb_predict_luma(h, sl, mb_type, is_h264, SIMPLE,
transform_bypass, PIXEL_SHIFT,
block_offset, linesize, dest_y, 0);
@@ -190,7 +190,7 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl)
}
}
- hl_decode_mb_idct_luma(h, mb_type, is_h264, SIMPLE, transform_bypass,
+ hl_decode_mb_idct_luma(h, sl, mb_type, is_h264, SIMPLE, transform_bypass,
PIXEL_SHIFT, block_offset, linesize, dest_y, 0);
if ((SIMPLE || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) &&
@@ -231,11 +231,11 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl)
if (is_h264) {
int qp[2];
if (chroma422) {
- qp[0] = h->chroma_qp[0] + 3;
- qp[1] = h->chroma_qp[1] + 3;
+ qp[0] = sl->chroma_qp[0] + 3;
+ qp[1] = sl->chroma_qp[1] + 3;
} else {
- qp[0] = h->chroma_qp[0];
- qp[1] = h->chroma_qp[1];
+ qp[0] = sl->chroma_qp[0];
+ qp[1] = sl->chroma_qp[1];
}
if (h->non_zero_count_cache[scan8[CHROMA_DC_BLOCK_INDEX + 0]])
h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + (16 * 16 * 1 << PIXEL_SHIFT),
@@ -248,16 +248,16 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl)
h->non_zero_count_cache);
} else if (CONFIG_SVQ3_DECODER) {
h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + 16 * 16 * 1,
- h->dequant4_coeff[IS_INTRA(mb_type) ? 1 : 4][h->chroma_qp[0]][0]);
+ h->dequant4_coeff[IS_INTRA(mb_type) ? 1 : 4][sl->chroma_qp[0]][0]);
h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + 16 * 16 * 2,
- h->dequant4_coeff[IS_INTRA(mb_type) ? 2 : 5][h->chroma_qp[1]][0]);
+ h->dequant4_coeff[IS_INTRA(mb_type) ? 2 : 5][sl->chroma_qp[1]][0]);
for (j = 1; j < 3; j++) {
for (i = j * 16; i < j * 16 + 4; i++)
if (h->non_zero_count_cache[scan8[i]] || h->mb[i * 16]) {
uint8_t *const ptr = dest[j - 1] + block_offset[i];
ff_svq3_add_idct_c(ptr, h->mb + i * 16,
uvlinesize,
- ff_h264_chroma_qp[0][h->qscale + 12] - 12, 2);
+ ff_h264_chroma_qp[0][sl->qscale + 12] - 12, 2);
}
}
}
@@ -282,7 +282,7 @@ static av_noinline void FUNC(hl_decode_mb_444)(H264Context *h, H264SliceContext
int linesize;
int i, j, p;
int *block_offset = &h->block_offset[0];
- const int transform_bypass = !SIMPLE && (h->qscale == 0 && h->sps.transform_bypass);
+ const int transform_bypass = !SIMPLE && (sl->qscale == 0 && h->sps.transform_bypass);
const int plane_count = (SIMPLE || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) ? 3 : 1;
for (p = 0; p < plane_count; p++) {
@@ -347,7 +347,7 @@ static av_noinline void FUNC(hl_decode_mb_444)(H264Context *h, H264SliceContext
linesize, 1, 1, SIMPLE, PIXEL_SHIFT);
for (p = 0; p < plane_count; p++)
- hl_decode_mb_predict_luma(h, mb_type, 1, SIMPLE,
+ hl_decode_mb_predict_luma(h, sl, mb_type, 1, SIMPLE,
transform_bypass, PIXEL_SHIFT,
block_offset, linesize, dest[p], p);
@@ -363,7 +363,7 @@ static av_noinline void FUNC(hl_decode_mb_444)(H264Context *h, H264SliceContext
}
for (p = 0; p < plane_count; p++)
- hl_decode_mb_idct_luma(h, mb_type, 1, SIMPLE, transform_bypass,
+ hl_decode_mb_idct_luma(h, sl, mb_type, 1, SIMPLE, transform_bypass,
PIXEL_SHIFT, block_offset, linesize,
dest[p], p);
}