comparison sp5xdec.c @ 5818:e0a872dd3ea1 libavcodec

Fix MJPEG decoder for AMV files. Since decoding is doing from the end and aligned by 16 previous code worked correctly only when picture height was dividable by 16, otherwise it provides garbage in top lines and truncates bottom. New code adjusts data[] pointers taking in account alignment issue.
author voroshil
date Sat, 13 Oct 2007 17:38:58 +0000
parents 810067f2c33d
children b42a510e0939
comparison
equal deleted inserted replaced
5817:ced30500e2b1 5818:e0a872dd3ea1
85 85
86 /* EOI */ 86 /* EOI */
87 recoded[j++] = 0xFF; 87 recoded[j++] = 0xFF;
88 recoded[j++] = 0xD9; 88 recoded[j++] = 0xD9;
89 89
90 avctx->flags &= ~CODEC_FLAG_EMU_EDGE;
90 i = ff_mjpeg_decode_frame(avctx, data, data_size, recoded, j); 91 i = ff_mjpeg_decode_frame(avctx, data, data_size, recoded, j);
91 92
92 av_free(recoded); 93 av_free(recoded);
93 94
94 #else 95 #else
205 CODEC_ID_AMV, 206 CODEC_ID_AMV,
206 sizeof(MJpegDecodeContext), 207 sizeof(MJpegDecodeContext),
207 ff_mjpeg_decode_init, 208 ff_mjpeg_decode_init,
208 NULL, 209 NULL,
209 ff_mjpeg_decode_end, 210 ff_mjpeg_decode_end,
210 sp5x_decode_frame, 211 sp5x_decode_frame
211 CODEC_CAP_DR1
212 }; 212 };