diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-16 02:21:35 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-16 02:22:27 +0200 |
commit | 1fe45903b81fd7c3c81292723affac7de4f4e4ee (patch) | |
tree | 3b17fa1575fb10c7af41601d63acde9dd8309d41 /libavcodec | |
parent | ba31e59e83ca23b6d456ab3bc2d08bed3772d477 (diff) | |
download | ffmpeg-1fe45903b81fd7c3c81292723affac7de4f4e4ee.tar.gz |
msvideo1enc: fix interframe encoding
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/msvideo1enc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/msvideo1enc.c b/libavcodec/msvideo1enc.c index d5088feeb8..e0efb4823f 100644 --- a/libavcodec/msvideo1enc.c +++ b/libavcodec/msvideo1enc.c @@ -110,7 +110,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, bestscore = 0; for(j = 0; j < 4; j++){ for(i = 0; i < 4*3; i++){ - int t = prevptr[x*3 + i + j*p->linesize[0]] - c->block[i + j*4*3]; + int t = prevptr[x*3 + i - j*3*avctx->width] - c->block[i + j*4*3]; bestscore += t*t; } } @@ -204,14 +204,14 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, for(j = 0; j < 4; j++) for(i = 0; i < 4; i++) for(k = 0; k < 3; k++) - prevptr[i*3 + k - j*3*avctx->width] = c->avg[k]; + prevptr[x*3 + i*3 + k - j*3*avctx->width] = c->avg[k]; break; case MODE_2COL: for(j = 0; j < 4; j++){ for(i = 0; i < 4; i++){ flags |= (c->output[i + j*4]^1) << (i + j*4); for(k = 0; k < 3; k++) - prevptr[i*3 + k - j*3*avctx->width] = c->codebook[c->output[i + j*4]*3 + k]; + prevptr[x*3 + i*3 + k - j*3*avctx->width] = c->codebook[c->output[i + j*4]*3 + k]; } } bytestream_put_le16(&dst, flags); @@ -223,7 +223,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, for(i = 0; i < 4; i++){ flags |= (c->output2[remap[i + j*4]]^1) << (i + j*4); for(k = 0; k < 3; k++) - prevptr[i*3 + k - j*3*avctx->width] = c->codebook2[(c->output2[remap[i+j*4]] + (i&2) + (j&2)*2)*3 + k]; + prevptr[x*3 + i*3 + k - j*3*avctx->width] = c->codebook2[(c->output2[remap[i+j*4]] + (i&2) + (j&2)*2)*3 + k]; } } bytestream_put_le16(&dst, flags); |