diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-09-04 17:04:51 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-09-04 17:04:51 +0200 |
commit | 9dcc4c30f9d8ef70d3c07b4a77fdc507e8766107 (patch) | |
tree | ae6bb70dcf614bfbf032b5fe4ac4f712777cd0c3 /libavcodec/mss1.c | |
parent | 9de7622927b1b0ec6f8045b17b3116f046f44b87 (diff) | |
parent | b36f87ff90d87687f574d51385f47bb98d14600a (diff) | |
download | ffmpeg-9dcc4c30f9d8ef70d3c07b4a77fdc507e8766107.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
configure: add support for bdver1 and bdver2 CPU types.
avio: make avio_close NULL the freed buffer
pixdesc: cosmetics
proresenc: Don't free a buffer not owned by the codec
proresenc: Write the full value in one put_bits call
adpcmenc: Calculate the IMA_QT predictor without overflow
x86: Add convenience macros to check for CPU extensions and flags
x86: h264dsp: drop some unnecessary ifdefs around prototype declarations
mss12: merge decode_pixel() and decode_top_left_pixel()
mss12: reduce SliceContext size from 1067 to 164 KB
mss12: move SliceContexts out of the common context into the codec contexts
Conflicts:
libavformat/aviobuf.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mss1.c')
-rw-r--r-- | libavcodec/mss1.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libavcodec/mss1.c b/libavcodec/mss1.c index d622e2ca61..c90485b512 100644 --- a/libavcodec/mss1.c +++ b/libavcodec/mss1.c @@ -30,7 +30,7 @@ typedef struct MSS1Context { MSS12Context ctx; AVFrame pic; - SliceContext sc[2]; + SliceContext sc; } MSS1Context; static void arith_normalise(ArithCoder *c) @@ -89,7 +89,7 @@ static int arith_get_number(ArithCoder *c, int mod_val) return val; } -static int arith_get_prob(ArithCoder *c, int *probs) +static int arith_get_prob(ArithCoder *c, int16_t *probs) { int range = c->high - c->low + 1; int val = ((c->value - c->low + 1) * probs[0] - 1) / range; @@ -162,7 +162,8 @@ static int mss1_decode_frame(AVCodecContext *avctx, void *data, int *data_size, c->pal_stride = -ctx->pic.linesize[0]; c->keyframe = !arith_get_bit(&acoder); if (c->keyframe) { - ff_mss12_codec_reset(c); + c->corrupted = 0; + ff_mss12_slicecontext_reset(&ctx->sc); pal_changed = decode_pal(c, &acoder); ctx->pic.key_frame = 1; ctx->pic.pict_type = AV_PICTURE_TYPE_I; @@ -172,7 +173,7 @@ static int mss1_decode_frame(AVCodecContext *avctx, void *data, int *data_size, ctx->pic.key_frame = 0; ctx->pic.pict_type = AV_PICTURE_TYPE_P; } - c->corrupted = ff_mss12_decode_rect(&c->sc[0], &acoder, 0, 0, + c->corrupted = ff_mss12_decode_rect(&ctx->sc, &acoder, 0, 0, avctx->width, avctx->height); if (c->corrupted) return AVERROR_INVALIDDATA; @@ -194,7 +195,7 @@ static av_cold int mss1_decode_init(AVCodecContext *avctx) c->ctx.avctx = avctx; avctx->coded_frame = &c->pic; - ret = ff_mss12_decode_init(&c->ctx, 0); + ret = ff_mss12_decode_init(&c->ctx, 0, &c->sc, NULL); avctx->pix_fmt = PIX_FMT_PAL8; |